Programming language e.g. PHP, JAVASCRIPT, coding, web developing hints and skills applying on mobile device e.g. iphone
2012/06/14
PHP利用EOT代替ECHO輸出
有時要在PHP加入JS/HTML, 會因為括號問題而需要很多改動....
間中會在OPEN SOURCE CODE 中見到以下方法
---------------------------------------------------------------------
使用eot的時候,好處就是可以直接把網頁的html當成一般的php程式一樣放在程式中,不用特別的去寫
<?php
echo <<< EOT
<div>新增 Div 標籤的內容放在這裡</div>
EOT;
?>
用法大概就是上面那樣,但要注意的地方是
1:<<<EOT 使用的時候,後面要是空的,不能夠有任何的資料在,空格也不行
2:EOT;這個一定要放在最前面,前面不能夠有任何的資料,空格也不行
2012/06/08
Sitemap.xml cannot change name - Path “/ sitemap_es.xml” is not available and can not be used
I also ran into that, and there’s a simple reason, and a simple and clean solution, which doesn’t tap any code.
They simply limit the file naming to this pattern: “/*/sitemap.xml”. So you can choose any directory, but you’ve to name the file “sitemap.xml”.
That implies, that you create an own directory for every sitemap you generate!
But regardless how simple the solution might be, the question arrises, WHY it is like that at all?! I can’t think of any reason, and it’s not even mentioned anywhere in the admin interface, so of course, you’re confused and start checking path permissions, etc.,
This is even the case with the latest 1.6!
Sourcinggate’s modification is not a very good idea, as it makes a maybe also otherwise used verification function to always return true, so you might mess up paths somewhere else, and Magento can’t tell you anymore.
So, here’s the fix:
In
/app/code/core/Mage/Adminhtml/etc/config.xml
Replace (at around line 190)
<any_path>/*/sitemap.xml</any_path>
with
<!-- zLabs | Black | BEGIN -->
<!-- No wonder, that we couldn't save any other filename than sitemap.xml ;)
Is this a bug, or a "protection" feature? It doesn't tell this anywhere
in the admin interface ... -->
<!-- <any_path>/*/sitemap.xml</any_path> -->
<!-- zLabs | Black | END -->
訂閱:
留言 (Atom)