路由名称" Admin \ Controller \ AdminController"没找到zend 2.3

时间:2015-08-10 07:23:24

标签: php zend-framework

大家好,我有以下问题。一旦我尝试使用zend表单创建一个表单,并看到一个错误,该表示找不到我的表单。讨论ot form class not found zend 2.3

按照推荐,我改变了文件名,以资本后者开头。现在我收到一个错误,指出root名称admin / controller / AdminController未找到。模块是使用zend studio new-> zend item-> create module创建的。如果它有用的话,这是错误的堆栈跟踪:

#0 C:\xampp\htdocs\disability\vendor\zendframework\zendframework\library\Zend\View\Helper\Url.php(100): Zend\Mvc\Router\Http\TreeRouteStack->assemble(Array, Array)
#1 [internal function]: Zend\View\Helper\Url->__invoke('Admin\Controlle...', Array)
#2 C:\xampp\htdocs\disability\vendor\zendframework\zendframework\library\Zend\View\Renderer\PhpRenderer.php(399): call_user_func_array(Object(Zend\View\Helper\Url), Array)
#3 C:\xampp\htdocs\disability\module\Admin\view\admin\admin\addstudent.phtml(5): Zend\View\Renderer\PhpRenderer->__call('url', Array)
#4 C:\xampp\htdocs\disability\module\Admin\view\admin\admin\addstudent.phtml(5): Zend\View\Renderer\PhpRenderer->url('Admin\Controlle...', Array)
#5 C:\xampp\htdocs\disability\vendor\zendframework\zendframework\library\Zend\View\Renderer\PhpRenderer.php(506): include('C:\xampp\htdocs...')
#6 C:\xampp\htdocs\disability\vendor\zendframework\zendframework\library\Zend\View\View.php(205): Zend\View\Renderer\PhpRenderer->render(Object(Zend\View\Model\ViewModel))
#7 C:\xampp\htdocs\disability\vendor\zendframework\zendframework\library\Zend\View\View.php(233): Zend\View\View->render(Object(Zend\View\Model\ViewModel))
#8 C:\xampp\htdocs\disability\vendor\zendframework\zendframework\library\Zend\View\View.php(198): Zend\View\View->renderChildren(Object(Zend\View\Model\ViewModel))
#9 C:\xampp\htdocs\disability\vendor\zendframework\zendframework\library\Zend\Mvc\View\Http\DefaultRenderingStrategy.php(103): Zend\View\View->render(Object(Zend\View\Model\ViewModel))
#10 [internal function]: Zend\Mvc\View\Http\DefaultRenderingStrategy->render(Object(Zend\Mvc\MvcEvent))
#11 C:\xampp\htdocs\disability\vendor\zendframework\zendframework\library\Zend\EventManager\EventManager.php(468): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#12 C:\xampp\htdocs\disability\vendor\zendframework\zendframework\library\Zend\EventManager\EventManager.php(207): Zend\EventManager\EventManager->triggerListeners('render', Object(Zend\Mvc\MvcEvent), Array)
#13 C:\xampp\htdocs\disability\vendor\zendframework\zendframework\library\Zend\Mvc\Application.php(352): Zend\EventManager\EventManager->trigger('render', Object(Zend\Mvc\MvcEvent))
#14 C:\xampp\htdocs\disability\vendor\zendframework\zendframework\library\Zend\Mvc\Application.php(327): Zend\Mvc\Application->completeRequest(Object(Zend\Mvc\MvcEvent))
#15 C:\xampp\htdocs\disability\public\index.php(17): Zend\Mvc\Application->run()
#16 {main}

您可能需要哪些或哪些其他信息来帮助解决此问题?

1 个答案:

答案 0 :(得分:1)

Simes就像我找到了解决方案。我认为问题在于模块中 的视图文件我给了管理员控制器的whol路径只是它的名字。 现在链接到行动看起来像这样:

$form->setAttribute('action', $this->url('admin', array('action' => 'addstudent')));

而不是

$form->setAttribute('action', $this->url('admin/controller/AdminController', array('action' => 'addstudent')));