部分: https://github.com/ZF-Commons/ZfcUser/issues/202
完整的答案: 现在我在module.config.php代码如下所示:
'zfcuser' => array(
'type' => 'Zend\Mvc\Router\Http\Literal',
'options' => array(
'route' => '', // the route is void isntead of default 'user'
),
),
'zfcuser-login' => array(
'type' => 'Literal',
'options' => array(
'route' => '/login',
'defaults' => array(
'controller' => 'zfcuser',
'action' => 'login',
),
),
),
'zfcuser-authenticate' => array(
'type' => 'Literal',
'options' => array(
'route' => '/authenticate',
'defaults' => array(
'controller' => 'zfcuser',
'action' => 'authenticate',
),
),
),
'zfcuser-logout' => array(
'type' => 'Literal',
'options' => array(
'route' => '/logout',
'defaults' => array(
'controller' => 'zfcuser',
'action' => 'logout',
),
),
),
'zfcuser-register' => array(
'type' => 'Literal',
'options' => array(
'route' => '/register',
'defaults' => array(
'controller' => 'zfcuser',
'action' => 'register',
),
),
),
'zfcuser-changepassword' => array(
'type' => 'Literal',
'options' => array(
'route' => '/change-password',
'defaults' => array(
'controller' => 'zfcuser',
'action' => 'changepassword',
),
),
),
'zfcuser-changeemail' => array(
'type' => 'Literal',
'options' => array(
'route' => '/change-email',
'defaults' => array(
'controller' => 'zfcuser',
'action' => 'changeemail',
),
),
),
我也希望用于登录/注册自定义模板等于是我把这个:
'view_manager' => array(
...
'template_path_stack' => array(
// to load our module view
'YOURMODULENAME' => __DIR__ . '/../view', // zfcuser have to load after
your module in your application.config.php !!!
),
我希望这将是有益的;)
可能的重复http://stackoverflow.com/questions/15494787/disable-default-zfcuser-routes?rq=1 – Crisp
你是真实的它不是那么远,这不是我正在寻找的答案。我找到了解决方案,但我现在不能回答我自己的帖子... – Angus