1

In my application, I need to apply this kind of address:

/film,pokaz,test-name,12.html

where: 'test-name' is some text and '12' is some ID.

Here's my router.ini:

showmovie.route = film,pokaz,:name,:id.html
showmovie.defaults.controller = movies
showmovie.defaults.action = show
showmovie.defaults.module = default
showmovie.defaults.name = ''
showmovie.defaults.id = ''

However, the url() helper seems to not fill those variables (:name and :id), so when I use it like:

$this->url(array('controller' => 'movies', 'action' => 'show', 'id' => 12, 'name' => 'testmovie'), 'showmovie', true, false);

it gives me this address:

/film,pokaz,:name,:id.html

Is there something wrong with my code or routing rule above?

1 Answer 1

1

The only separator you can use for named segments in the standard route type is /, so you'll need to do this as a regex route instead.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.