任何人都知道为什么Magento不允许在app/design文件夹之外的模板.phtml文件的符号链接?
如果我在该文件夹中执行符号链接,它可以正常工作,但如果它在外部链接,则不起作用.所以它似乎是一些权限/安全性的东西,但我无法在任何地方找到任何信息.
任何人?
解决方法:感谢艾伦的建议,我发现了一个解决方法 - 因为我只是自己用于本地开发我很开心.如果这有助于其他任何人,我会在这里添加它.所以我在core/Mage/Core/Block/Template.php中插入以下内容,直接在Varien_Profiler :: start($ fileName)行之后;
$storeId = Mage::app()->getStore()->getId();
$theme = Mage::getStoreConfig('design/package/name', $storeId);
Mage::Log($this->_viewDir.DS.$fileName);
$includes = $this->_viewDir.DS.$fileName;
if(strpos($includes, 'frontend/'.$theme )) {
include $this->_viewDir.DS.$fileName;
};
Run Code Online (Sandbox Code Playgroud)
使用IF语句可以阻止任何基本模板加倍,并且只允许自定义主题模板通过.