History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: ZF-3097
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Ben Scholzen
Reporter: Matthew Weier O'Phinney
Votes: 3
Watchers: 6
Operations

If you were logged in you would be able to see more operations.
Google issue summary
Zend Framework

Create new route for multilanguage sites

Created: 11/Apr/08 07:39 AM   Updated: 11/May/09 04:29 PM
Component/s: Zend_Controller
Affects Version/s: None
Fix Version/s: 1.8.0

Time Tracking:
Original Estimate: 1 hour
Original Estimate - 1 hour
Remaining Estimate: 1 hour
Remaining Estimate - 1 hour
Time Spent: Not Specified
Remaining Estimate - 1 hour

Issue Links:
Related
 

Tags:
Participants: Ben Scholzen, Matthew Weier O'Phinney and Thorsten Ruf


 Description  « Hide
An oft-used URL pattern for multi-lingual sites is to use the form '/:lang/...'. Currently, however, this is a difficult routing schema to achieve if you want to leave the flexibility to create a conventional modular site.

The suggestion is to create a route that extends the current Module route, and which takes an argument of a default language to use:

$router->addRoute('default', new Zend_Controller_Router_Route_Multilingual('de')); // default language is German

This would give such routes first-class support in the ZF MVC.



 All   Comments   Work Log   Change History   FishEye   Crucible      Sort Order: Ascending order - Click to sort in descending order
Matthew Weier O'Phinney - 04/Aug/08 10:24 AM
Postponing to 1.7.0; Martel and DASPRiD are working on a solution, part of which is included in 1.6, but the rest of which will happen for 1.7.0. At that time, we can easily add language-based routes.

Ben Scholzen - 18/Oct/08 05:44 PM
I'm only responsible for the config- and hostname-part. Martel is the maintainer of the actual partial path chaining. As he is currently quite busy, I don't think that partial path chaining will make it into 1.7. Even 1.8 isn't really clear.

Matthew Weier O'Phinney - 05/Nov/08 11:11 AM
Assigning to Ben; this is addressed with chained routes in 1.7.0, IIRC.

Ben Scholzen - 18/Apr/09 01:50 PM
Partial path route implemented in 1.8.

Thorsten Ruf - 11/May/09 03:05 PM
Can anybody of the participants explain, how to solve the requirements of a default multilanguage route? I can't see an solution using chained routes.

Ben Scholzen - 11/May/09 04:29 PM
You simply take a standard route ":language", and all your other routes. Then you say for example
$languageRoute = new Zend_Controller_Router_Route(':language', array('language' => 'de');
$blogRoute = new Zend_Controller_Router_Route_Static('blog');
$blogRoute = $languageRoute->chain($blogRoute);
$router->addRoute($blogRoute);

For more examples, see documentation or ask in #zftalk on chat.freenode.org.