i have an existing site written in zend that i wish to migrate over to yii without needing to write 30 routes.
the controllers and actions all follow the url example ‘/product-directory/blah-action/’ that should map directly to ProductDirectoryController and actionBlahAction.
Is there an easy way to do this without adding routes.
Is this a feature of yii? If not i reckon it should be.
You’ll need a rule in any case and this is no hacking but configuration . With the right regular expressions 1 single rule is sufficient. Did you read the section on parameterized url rules? It gives an example with a rule that contains all possible controller/action names. You can even replace that with a “match all” expression if you don’t want to specify all controller/action names.
As this is a very specific requirement i don’t think, this will be added as feature. But you always have the option to extend CUrlManager and override it’s createUrl and parseUrl methods and add your preferred logic there.