Zend Framework - 如何在 xml 文件中应用图标并检索它
当它加载xml文件时,图标会导致标签标签内的失败。如何修复它?
// horizontal top menu
<?xml version="1.0" encoding="UTF-8"?>
<root>
<nav>
<page1>
<label><img src='icon.icon' /> Page 1</label>
<controller>index</controller>
</page1>
<home>
<label>Home</label>
<controller>index</controller>
</home>
</nav>
</root>
// controller test
$config = new Zend_Config_Xml(APPLICATION_PATH . '/configs/navigation.xml', 'nav');
$container = new Zend_Navigation($config);
$this->view->navigation($container);
When it load the xml file, the icon cause failure inside the label tags. How to fix it?
// horizontal top menu
<?xml version="1.0" encoding="UTF-8"?>
<root>
<nav>
<page1>
<label><img src='icon.icon' /> Page 1</label>
<controller>index</controller>
</page1>
<home>
<label>Home</label>
<controller>index</controller>
</home>
</nav>
</root>
// controller test
$config = new Zend_Config_Xml(APPLICATION_PATH . '/configs/navigation.xml', 'nav');
$container = new Zend_Navigation($config);
$this->view->navigation($container);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我想你可以用 CSS 来代替
CSS
I suppose you could do it with CSS instead
CSS
它可能应该位于 cdata 部分:
http://msdn.microsoft.com /en-us/library/ms256076.aspx
It should probably be in a cdata section:
http://msdn.microsoft.com/en-us/library/ms256076.aspx