I have a couple of routes that don't work and i don't understand why because
all the others works, here my module.config.php : 

<pre>

return array(
'controllers' => array(
    'invokables' => array(
        'FrontApp\Controller\Index' =>
'FrontApp\Controller\IndexController',
        'FrontApp\Controller\User' => 'FrontApp\Controller\UserController',
    ),
),


'router' => array(
    'routes' => array(
        'confirm' => array(
            'type'    => 'Literal',
            'options' => array(
                'route'    => '/confirm',
                'defaults' => array(
                    'controller' => 'FrontApp\Controller\Index',
                    'action'     => 'confirm',
                ),
            ),
        ),
        'user' => array(
            'type'    => 'Literal',
            'options' => array(
                'route'    => '/connexion',
                'defaults' => array(
                    'controller' => 'FrontApp\Controller\User',
                    'action'     => 'index',
                ),
            ),
        ),
        'detail' => array(
            'type'    => 'Segment',
            'options' => array(
                'route'    => '/:type/:location/:id',
                'constraints' => array(
                    'type'     => '[a-zA-Z][a-zA-Z0-9_-]*',
                    'location' => '[a-zA-Z][a-zA-Z0-9_-]*',
                    'id'       => '[0-9]+',
                ),
                'defaults' => array(
                    'controller' => 'FrontApp\Controller\Index',
                    'action'     => 'detail',
                ),
            ),
        ),
        'search' => array(
            'type'    => 'Segment',
            'options' => array(
                'route'    => '/:type[/:location]',
                'constraints' => array(
                    'type'     => '[a-zA-Z][a-zA-Z0-9_-]*',
                    'location' => '[a-zA-Z][a-zA-Z0-9_-]*',
                ),
                'defaults' => array(
                    'controller' => 'FrontApp\Controller\Index',
                    'action'     => 'search',
                ),
            ),
        ),
        'front' => array(
            'type'    => 'Literal',
            'options' => array(
                'route'    => '/',
                'defaults' => array(
                    'controller' => 'FrontApp\Controller\Index',
                    'action'     => 'index',
                ),
            ),
        ),
    ),
),

'view_manager' => array(
    'display_not_found_reason' => true,
    'display_exceptions'       => true,
    'doctype'                  => 'HTML5',
    'not_found_template'       => 'error/404',
    'exception_template'       => 'error/index',
    'template_map' => array(
        'layout/layout'           => __DIR__ .
'/../view/layout/front-layout.phtml',
        'layout/frontlayout'           => __DIR__ .
'/../view/layout/front-layout.phtml',
        'frontapp/index/index' => __DIR__ .
'/../view/front-app/index/index.phtml',
        'error/404'               => __DIR__ . '/../view/error/404.phtml',
        'error/index'             => __DIR__ . '/../view/error/index.phtml',
    ),
    'template_path_stack' => array(
        'front' => __DIR__ . '/../view',
        'searcher' => __DIR__ . '/../view',
        'detail' => __DIR__ . '/../view',
        'user' => __DIR__ . '/../view',
        'confirm' => __DIR__ . '/../view',
    ),
),
'module_layouts' => array(
        'FrontApp' => 'layout/frontlayout',
        'BackApp' => 'layout/backlayout',
),);

</pre>

so when i try :

mywebsite/ -> work

mywebsite/one-type -> work

mywebsite/one-type/one-location -> don't work

mywebsite/one-type/one-location/on-id -> don't work

mywebsite/connexion ->work

mywebsite/confirm ->work

I'm little bit confused because its like you can't use different route type.
So, for the route that don't work i either have "....Unable to render
template layout/layout..." error which is resolve when i add 'layout/layout'
with the same path that 'layout/frontlayout' in template_map key (i also
don't really understand why but it work, so if you can enlighten me, i will
be very thankful), or, a "The requested URL could not be matched by
routing." and for this error, i'm stuck because i don't see where is the
issue :/

hope you can help :)



--
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/ZF2-matched-by-routing-tp4660753.html
Sent from the Zend Framework mailing list archive at Nabble.com.

-- 
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to