-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I see, you got so far yet. Well then, what's the actual problem? ................................... : ___ _ ___ ___ ___ _ ___ : : | \ /_\ / __| _ \ _ (_) \ : : | |) / _ \\__ \ _/ / | |) | : : |___/_/:\_\___/_| |_|_\_|___/ : :........:........................: : Web : http://www.dasprids.de : : E-mail : [email protected] : : Jabber : [email protected] : : ICQ : 105677955 : :........:........................:
[email protected] schrieb: > Ugh, maybe I should have given an example of what I have done so far, > no? ;-) > Here goes: > > > // bootstrap > // ROUTES SETUP - Setup routes > $router = $frontController->getRouter(); > $router->removeDefaultRoutes(); > > $defaultRoute = new nl_indetail_Controller_Router_Route_Translatable( > ':@module/:@controller/:@action/*', > array( > 'module' => 'default', > 'controller' => 'index', > 'action' => 'index' > ) > ); > $router->addRoute( 'default', $defaultRoute ); > > $defaultModuleRoute = new nl_indetail_Controller_Router_Route_Translatable( > ':@controller/:@action/*', > array( > 'module' => 'default', > 'controller' => 'index', > 'action' => 'index' > ) > ); > $router->addRoute( 'defaultModule', defaultModuleRoute ); > > > > ------------------------------------------------------------------------ > From: [email protected] > To: [email protected] > Date: Thu, 12 Mar 2009 14:23:07 +0000 > Subject: RE: [fw-general] Zend_Controller_Router_Route & Zend_Translate? > > Ben, > > I am implementing your Zend_Controller_Router_Route_Translatable right > now. It works very nice. One thing I have a hard time figuring out > though, is the following: > > > How would I be able to mimic the default ZF route including optional > modules, for instance such that: > /nieuwsbrief/aanmelden (newsletter/subscribe in Dutch) > routes to NewsletterController->subscribeAction() (default module) > > /beheerder/pagina/bewerken (admin/page/edit in Dutch) > could route to Admin_PageController->editAction() (admin module) > > Any ideas? Thanks in advance. > > > ------------------------------------------------------------------------ > From: [email protected] > To: [email protected] > Date: Fri, 27 Feb 2009 19:24:24 +0000 > Subject: RE: [fw-general] Zend_Controller_Router_Route & Zend_Translate? > > Ben, > > I'll have to get my head around it a little more. But at first glance, > this looks absolutely perfect for the job: just what I was looking for. > Thanks a lot! > > >> Date: Fri, 27 Feb 2009 19:36:47 +0100 >> From: [email protected] >> To: [email protected] >> Subject: Re: [fw-general] Zend_Controller_Router_Route & Zend_Translate? >> > Hehe, we just had the same topic some days ago. I solved the same > problem some time ago, with simply a new route (which > i will probably port to ZF in modified way some day). It works like this: > > Fixed text is prepended with an @, while translatable parameters are > prepended with :@. For example: > > route.about.type = 'App_Controller_Router_Route_Translatable > route.about.route = '@imprint' > > Now, the route looks for a Zend_Translate instance with the key > Zend_Translate within Zend_Registry, searches for the message-id > "imprint", translates it, and then tries to match the route. > > There are also translatable parameters as said before: > > route.statistics.type = 'App_Controller_Router_Route_Translatable > route.statistics.route = '@statistics/:@timerange' > > Here again, "statistics" is simply translated and matches. What the > :@timerange parameter does is the following: > > When you assemble the route like this: > > $urlHelper->url(array('timerange' => 'this-month'), 'statistics'); > > The route looks for a message with the id "this-month" and if available, > puts it into the url, else the message id itself. When matching a URL, > it replaces the translated parameter with the message id again, so you > don't have to care about it in your application itself. > > For the route code, see the attached file. > > Regards, > Ben > ................................... > : ___ _ ___ ___ ___ _ ___ : > : | \ /_\ / __| _ \ _ (_) \ : > : | |) / _ \\__ \ _/ / | |) | : > : |___/_/:\_\___/_| |_|_\_|___/ : > :........:........................: > : Web : http://www.dasprids.de : > : E-mail : [email protected] : > : Jabber : [email protected] : > : ICQ : 105677955 : > :........:........................: > > > [email protected] schrieb: >> Hi y'all, > >> Is there any easy way to implement routes such that they honour >> translations as well, without having to manually create routes for them? > >> For instance: >> /gebruiker/aanmelden >> /benutzer/anmelden >> Should both route to >> /user/sign-up > >> Or something similar. > >> Cheers > >> ------------------------------------------------------------------------ >> Deel en publiceer je favoriete foto's met Windows Live Photos >> <www.photos.live.com> > ------------------------------------------------------------------------ > Deel en publiceer je favoriete foto's met Windows Live Photos > <http://www.photos.live.com> > ------------------------------------------------------------------------ > Ook nieuwsgierig naar de nieuwe Messenger? Download 'm hier > <http://windowslive.microsoft.nl/WL/Explore/Messenger> > ------------------------------------------------------------------------ > Twee keer zo leuk. Deel foto's terwijl je chat met de nieuwe Messenger > <http://windowslive.microsoft.nl/WL/Explore/Messenger> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkm5UM4ACgkQ0HfT5Ws789CO8wCgkdcSNeyxxpuVj2CXCQwCAmEZ v2YAoIPwYInN90pH8HVNCPgvblSD3Ck5 =S3b8 -----END PGP SIGNATURE-----
