我希望有人可以帮助我 .
我正在通过Rob Allen的Zend Framework 2教程 .
当我试着去:
http://zf2-tutorial.localhost/album我在apache的日志中遇到以下错误(我使用Zend Server CE版免费):
PHP致命错误:在第175行的C:\ Program Files \ Zend \ Apache2 \ htdocs \ zf2-tutorial \ vendor \ zendframework \ zendframework \ library \ Zend \ ServiceManager \ AbstractPluginManager.php中找不到类'Album \ Controller \ AlbumController'
模块\专辑\ module.config.php
<?php
return array(
'controllers' => array(
'invokables' => array(
'Album\Controller\Album' => 'Album\Controller\AlbumController'
),
),
'router' => array(
'routes' => array(
'album' => array(
'type' => 'segment',
'options' => array(
'route' => '/album[/:action][/:id]',
'constraints' => array(
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
'id' => '[0-9]+',
),
'defaults' => array(
'controller' => 'Album\Controller\Album',
'action' => 'index',
),
),
),
),
),
'view_manager' => array(
'template_path_stack' => array(
'album' => __DIR__ . '/../view'
)
)
);
模块\相册\ SRC \相册\控制器\ Albumcontroller.php
<?php
namespace Album\Controller;
use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\ViewModel;
class AlbumController extends AbstractActionController
{
protected $albumTable;
public function getAlbumTable()
{
if (!$this->albumTable) {
$sm = $this->getServiceLocator();
$this->albumTable = $sm->get('Album\Model\AlbumTable');
}
return $this->albumTable;
}
public function indexAction()
{
return new ViewModel(array(
'albums' => $this->getAlbumTable()->fetchAll(),
));
}
public function addAction()
{
}
public function editAction()
{
}
public function deleteAction()
{
}
}
我的配置:
Windows XP . Zend Server CE技术预览版(PHP 5.3) .
谢谢您的帮助