1
젠드 프레임 워크를 찾을 수 없습니다 ...이 내 모듈 난 젠드에 새로 온 사람과이 zend경로가 나는이 문제를 해결할 수없는 2
Zend\Mvc\Router\Exception\RuntimeException File: C:\wamp\www\test\vendor\zendframework\zendframework\library\Zend\Mvc\Router\Http\TreeRouteStack.php:317 Message: Route with name "course" not found
에서 변형 예이다 나는이 없기 때문에 .config.php
<?php
return array(
'controllers' => array(
'invokables' => array(
'Course\Controller\Index' => 'Course\Controller\IndexController',
), ),
'router' => array(
'routes' => array(
'index' => array(
'type' => 'Literal',
'options' => array(
'route' => '/course',
'defaults' => array(
'controller' => 'Course\Controller\Index',
'action' => 'index'
),
),
),
)
),
'view_manager' => array(
'template_path_stack' => array(
'course' => __DIR__ . '/../view/'
),
)
);
및 IndexController.php는
<?php
namespace Course\Controller;
use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\ViewModel;
class IndexController extends AbstractActionController{
protected $courseTable;
public function indexAction()
{
return new ViewModel(array(
'courses' => $this->getCourseTable()->fetchAll(),
));
}
public function getCourseTable()
{
if (!$this->courseTable) {
$sm = $this->getServiceLocator();
$this->courseTable = $sm->get('Course\Model\CourseTable');
}
return $this->courseTable;
}
}
들, 저를 도와주세요 이것에 대한 잘못된 생각.
하지만 난 이름을 변경하는 경우, 다음이 오류를 참조하십시오 치명적인 오류 : 젠드 \ MVC \ 라우터 \ 예외 \의 RuntimeException의를 : 경로 이름으로 "인덱스"를하지 C : \ wamp \ www \ test \ vendor \ zendframework \ zendframework \ library \ Zend \ View \ Helper \ Navigation \ AbstractHelper.php 169 에 나와 있습니다. 자세한 내용을 알려 주시면 감사하겠습니다. – user3661744
보기에서 두 개의 다른 이름으로 경로를 언급하는 것 같습니다. 당신은 일관성이 있어야합니다. –