PHP interesse |
|
Ik zit met het volgende probleem... De url view helper, die standaard bij het Zend framework zit gooit steeds met een foutmelding bij mij zodra ik een router ga toevoegen bij de parameters van de helper)
Ik heb mijn router gedefinieerd in een xml schema...
<?xml version="1.0"?>
<configdata>
<router>
<contact>
<type>Zend_Controller_Router_Route_Regex</type>
<route>contact.html</route>
<defaults>
<controller>contact</controller>
<action>index</action>
</defaults>
</contact>
</router>
</configdata>
<?xml version="1.0"?> <configdata> <router> <contact> <type>Zend_Controller_Router_Route_Regex</type> <route>contact.html</route> <defaults> <controller>contact</controller> <action>index</action> </defaults> </contact> </router> </configdata>
In mijn index laad ik hem gewoon in...
$frontcontroller->getRouter()->addConfig(new Zend_Config_Xml('./application/router.xml'), 'router');
$frontcontroller->getRouter()->addConfig(new Zend_Config_Xml('./application/router.xml'), 'router');
Vervolgens op index.phtml van me contactController gooi ik dit eruit...
<?= $this->url(array(), 'contact') ?>
<?= $this->url(array(), 'contact') ?>
In dat geval krijg ik een mooie 500 error waarna ik de volgende leuke error krijg gelogd van zend.
2008-12-19T20:22:22+01:00 DEBUG (7): Cannot assemble. Reversed route is not specified.\n#0 C:\xampp\htdocs\weblog\library\Zend\Controller\Router\Rewrite.php(377): Zend_Controller_Router_Route_Regex->assemble(Array, false, true)
#1 C:\xampp\htdocs\weblog\library\Zend\View\Helper\Url.php(49): Zend_Controller_Router_Rewrite->assemble(Array, 'contact', false, true)
#2 C:\xampp\htdocs\weblog\library\Zend\View\Abstract.php(318): Zend_View_Helper_Url->url(Array, 'contact')
#3 [internal function]: Zend_View_Abstract->__call(Array, Array)
#4 C:\xampp\htdocs\weblog\templates\twotenths\view\contact\index.phtml(46): Zend_View->url('url', Array)
#5 C:\xampp\htdocs\weblog\library\Zend\View.php(107): include('C:\xampp\htdocs...')
#6 C:\xampp\htdocs\weblog\library\Zend\View\Abstract.php(787): Zend_View->_run(Array, 'contact')
#7 C:\xampp\htdocs\weblog\library\Zend\Controller\Action\Helper\ViewRenderer.php(902): Zend_View_Abstract->render('.\templates\two...')
#8 C:\xampp\htdocs\weblog\library\Zend\Controller\Action\Helper\ViewRenderer.php(923): Zend_Controller_Action_Helper_ViewRenderer->renderScript('contact/index.p...')
#9 C:\xampp\htdocs\weblog\library\Zend\Controller\Action\Helper\ViewRenderer.php(962): Zend_Controller_Action_Helper_ViewRenderer->render('contact/index.p...', NULL)
#10 C:\xampp\htdocs\weblog\library\Zend\Controller\Action\HelperBroker.php(276): Zend_Controller_Action_Helper_ViewRenderer->postDispatch()
#11 C:\xampp\htdocs\weblog\library\Zend\Controller\Action.php(513): Zend_Controller_Action_HelperBroker->notifyPostDispatch()
#12 C:\xampp\htdocs\weblog\library\Zend\Controller\Dispatcher\Standard.php(285): Zend_Controller_Action->dispatch()
#13 C:\xampp\htdocs\weblog\library\Zend\Controller\Front.php(934): Zend_Controller_Dispatcher_Standard->dispatch('indexAction')
#14 C:\xampp\htdocs\weblog\index.php(176): Zend_Controller_Front->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#15 {main}
2008-12-19T20:22:22+01:00 DEBUG (7): Cannot assemble. Reversed route is not specified.\n#0 C:\xampp\htdocs\weblog\library\Zend\Controller\Router\Rewrite.php(377): Zend_Controller_Router_Route_Regex->assemble(Array, false, true) #1 C:\xampp\htdocs\weblog\library\Zend\View\Helper\Url.php(49): Zend_Controller_Router_Rewrite->assemble(Array, 'contact', false, true) #2 C:\xampp\htdocs\weblog\library\Zend\View\Abstract.php(318): Zend_View_Helper_Url->url(Array, 'contact') #3 [internal function]: Zend_View_Abstract->__call(Array, Array) #4 C:\xampp\htdocs\weblog\templates\twotenths\view\contact\index.phtml(46): Zend_View->url('url', Array) #5 C:\xampp\htdocs\weblog\library\Zend\View.php(107): include('C:\xampp\htdocs...') #6 C:\xampp\htdocs\weblog\library\Zend\View\Abstract.php(787): Zend_View->_run(Array, 'contact') #7 C:\xampp\htdocs\weblog\library\Zend\Controller\Action\Helper\ViewRenderer.php(902): Zend_View_Abstract->render('.\templates\two...') #8 C:\xampp\htdocs\weblog\library\Zend\Controller\Action\Helper\ViewRenderer.php(923): Zend_Controller_Action_Helper_ViewRenderer->renderScript('contact/index.p...') #9 C:\xampp\htdocs\weblog\library\Zend\Controller\Action\Helper\ViewRenderer.php(962): Zend_Controller_Action_Helper_ViewRenderer->render('contact/index.p...', NULL) #10 C:\xampp\htdocs\weblog\library\Zend\Controller\Action\HelperBroker.php(276): Zend_Controller_Action_Helper_ViewRenderer->postDispatch() #11 C:\xampp\htdocs\weblog\library\Zend\Controller\Action.php(513): Zend_Controller_Action_HelperBroker->notifyPostDispatch() #12 C:\xampp\htdocs\weblog\library\Zend\Controller\Dispatcher\Standard.php(285): Zend_Controller_Action->dispatch() #13 C:\xampp\htdocs\weblog\library\Zend\Controller\Front.php(934): Zend_Controller_Dispatcher_Standard->dispatch('indexAction') #14 C:\xampp\htdocs\weblog\index.php(176): Zend_Controller_Front->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #15 {main}
Verder werkt $this->url() wel gewoon alleen dit geeft /weblog/contact terug. Terwijl dit toch automatisch (volgens mij) ook eigenlijk al /weblog/contact.html moet zijn...
Iemand misschien enig idee...?
|