문제가 있습니다. 내 프로젝트에서 zfcuser를 사용하고 있는데 이제 프로필 페이지를 만들고 싶습니다. I'have는 UserController에 showAction()를 만들어,하지만 난 웹 브라우저에 URL을 넣을 때, 나는 하나의 행에있는 모든 사용자의 정보를 얻을 수Zfc 사용자 및 사용자 정의 showAction()
public function showAction()
{
$id = (int) $this->params()->fromRoute('id', 0);
if (!$id) {
return $this->redirect()->toRoute('zfcuser', array(
'action' => 'register'
));
}
try {
$user = $this->zfcUserAuthentication()->getIdentity()->getUser($id);
}
catch (\Exception $ex) {
return $this->redirect()->toRoute('zfcuser', array(
'action' => 'register'
));
}
return new ViewModel(array(
'user' => $user));
}
I도 만들어 사용자 정의 기능 (404)을 가지고 있습니다. 은 다음과 같습니다
public function getUser($id){
$rowset = $this->tableGateway->select(array('user_id' => $id));
$row = $rowset->current();
return $row;
}
그리고 법인/User.php에
내가 그 잘못 module.config 생각 UserController.php이것은 ZFC 내 showAction()이지만, 어쨌든 작동하지 않습니다. 내 module.config를 다음으로 변경했습니다.
'show' => array(
'type' => 'Literal',
'options' => array(
'route' => '/show[/][:id]',
'defaults' => array(
'controller' => 'zfcuser',
'action' => 'show',
),
),
),
내 문제는이 컨트롤러 동작을 표시하는 URL에 도달 할 수 없다는 것입니다. 문제가 될 수 있습니다. 간단한 사용자 프로필 페이지를 만들고 싶습니다.
가 ZFC 사용자의 childroute을 보여입니다 :
이 완료 slideshare에 봐? – cptnk