Havin in a Zend Module following structure
Name of Module
- Test
- config
- src
- view
- layout
- test
- index
- index.phtml
- login
- index.phtml
- register
- index.phtml
- index
- Module.php
Now when accessing website for example for login file it will be as following http://justsite.something.com/login
Problem Need to change to http://justsite.something.com/login/ for that i added to login folder another folder index and there putted index.phtml file like this
- login
- index
- index.phtml
- index
But that doesn't seem to work. Should i change in LoginController.php for this to work?
module.confing.php
'router' => array(
'routes' => array(
'test' => array(
'type' => 'Literal',
'options' => array(
'route' => '/test',
'defaults' => array(
'__NAMESPACE__' =>'Test\Controller',
'controller' => 'Index',
'action' => 'index',
),
),
'may_terminate' => true,
'child_routes' => array(
'default' => array(
'type' => 'Segment',
'options' => array(
'route' =>
'/[:controller[/:action]]',
'constraints' => array(
'controller' =>
'[a-zA-Z][a-zA-Z0-9_-]*',
'action' =>
'[a-zA-Z][a-zA-Z0-9_-]*',
),
'defaults' => array(),
),
),
),
),
'login' => array(
'type' => 'Literal',
'options' => array(
'route' => '/login/', // PUT HERE WHATEVER YOU WANT
'defaults' => array( // AND MAP THAT URL TO CONTROLLER/ACTION
'__NAMESPACE__' =>'Test\Controller',
'controller' => 'Login',
'action' => 'index',
),
),
),
),
),
Fixed Just added
'may_terminate' => true,
'child_routes' => array(
'default' => array(
'type' => 'Segment',
'options' => array(
'route' =>
'/[:controller[/:action]/]',