Hi all,
I'm trying to make a Navigation using XML and i get the following and i'm
not sure why because code looks right to me.
Below is the Fatal Error , XML file , _initNavigation() in Bootstrap file
Fatal error: Uncaught exception 'Zend_Config_Exception' with message
'simplexml_load_file() [ function.simplexml-load-file
function.simplexml-load-file ]:
file:///C:/wamp/www/ZendCasts/front_application/configs/navigation.xml:1:
parser error : parsing XML declaration: '?>' expected
simplexml_load_file() [ function.simplexml-load-file
function.simplexml-load-file ]: <?xml version='1.0' encoding='UTF-8'>
simplexml_load_file() [ function.simplexml-load-file
function.simplexml-load-file ]: ^' in
C:\wamp\www\ZendCasts\library\Zend\Config\Xml.php:93 Stack trace: #0
C:\wamp\www\ZendCasts\front_application\Bootstrap.php(46):
Zend_Config_Xml->__construct('C:\wamp\www\Zen...', 'nav') #1
C:\wamp\www\ZendCasts\library\Zend\Application\Bootstrap\BootstrapAbstract.php(580):
Bootstrap->_initNavigation() #2
C:\wamp\www\ZendCasts\library\Zend\Application\Bootstrap\BootstrapAbstract.php(533):
Zend_Application_Bootstrap_BootstrapAbstract->_executeResource('na in
C:\wamp\www\ZendCasts\library\Zend\Config\Xml.php on line 93
//Boot Strap Navigation
public function _initNavigation()
{
$this->bootstrap('layout');
$layout = $this->getResource('layout');
$view = $layout->getView();
$config = new Zend_Config_Xml(APPLICATION_PATH .
'/configs/navigation.xml' , 'nav');
$navigation = new Zend_Navigation($config);
$view->navigation($navigation);
}
//XML File
<?xml version='1.0' encoding='UTF-8'>
<configdata>
<nav>
<profile>
<label>Profile</label>
<uri>/Profile/index</uri>
<pages>
<index>
<label>Profile</label>
<uri>/Profile/index</uri>
</index>
<editProfile>
<label>Edit Profile</label>
<uri>/Profile/edit</uri>
</editProfile>
<uploadAvatar>
<label>Upload Avatar</label>
<uri>/Profile/editavatar</uri>
</uploadAvatar>
</pages>
</profile>
</nav>
</configdata>
--
View this message in context:
http://n4.nabble.com/Zend-Config-Exception-tp991935p991935.html
Sent from the Zend Framework mailing list archive at Nabble.com.