ZF2 segment route: only last element

65 Views Asked by At

I have this segment route:

'content' => array(
    'type'    => 'Segment',
    'options' => array(
        'route'    => '/:title{-}-:id',
        'constraints' => array(
            'title'         => '[a-zA-Z0-9_-]*',
            'id'            => '[0-9]+',
        ),
        'defaults' => array(
            'controller'    => 'content',
            'action'        => 'index',
        ),
    ),
),

And it properly recognize an url like this, with "id=20":

http://example.com/blood-on-ice-20

but it recognize "id=20" also with this url:

http://example.com/timekeeper-20th-anniversary-box-12951

how can I avoid this?

0

There are 0 best solutions below