0

This is a rails 3 code

match '/articles(/:year(/:month(/:day)))' => 'posts#index'"

that match url where some parts can be omitted to post controller and index action

What is the most elegant way to make the same in Zend Framework

0

1 Answer 1

1

I think this route should be enough:

$route = new Zend_Controller_Router_Route( 'articles/:year/:month/:day', array( 'year' => date("Y"), 'month' => date("m"), 'day' => date("d"), 'controller' => 'post', 'action' => 'index' ), array( 'year' => '\d+', 'month' => '\d+', 'day' => '\d+', ) ); 

Defaults to current day/month/year

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.