Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

How to set action in the current router in the url?

how to put action as a parameter in the url?

example:

router:

 $this->add (
            '/controller/:action/:int/:params',
            array (
                'action' => 1,
                'id'     => 2,
            )
        )
        ->setName ( 'Router' );

volt:

{{ url(['for': 'Router',  'action':'index', 'id':51 ]) }}

return localhost/controller//51



1.0k
Accepted
answer
edited Aug '16

I found the error, the router comes into conflict with arguments that have default numeric..

exemplo

 $this->add (
            '/controller/:action/:int/:params',
            array (
                'action' => 1,
                'id'     => 2,
                'page' => 1 //value default 1 conflicts with action 1
            )
        )
        ->setName ( 'teste' );