我的控制器是
public function loadprojectAction()
{
$this->layout ( 'layout/layoutin' );
$id = (int) $this->params()->fromRoute('id', 0);
echo $id;
if (!$id) {
return $this->redirect()->toRoute('album', array(
'action' => 'add'
));
}
//$album = $this->getAlbumTable()->getAlbum($id);
// This shows the :controller and :action parameters in default route
// are working when you browse to /project/project/foo
return array();
}
我的路线是。
'routes' => array (
'project' => array (
'type' => 'segment',
'options' => array (
'route' => '/project[/:action][/:id]',
'constraints' => array (
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
'id' => '[0-9]+'
),
'defaults' => array (
'controller' => 'Project\Controller\Project',
'action' => 'index'
)
),
)
)
布局不会显示图像和任何其他东西只有布局的主体。但它会加载图像标题。