Ben,

You are absolutely right about SEO and administration of course. But it was 
just to try a prove of concept. Cause I can see myself using this in the 
current project or some project in the near future. Thing is... I can't get it 
to work. I must be doing somethin wrong. I have my controller directories set 
up with:


$frontController->setControllerDirectory(
        array(
                'default' => APPLICATION_PATH . '/modules/default/controllers',
                'admin' => APPLICATION_PATH . '/modules/admin/controllers'
        )
 );

And the rest as per my example in the other post (in which I missed a $ sign, 
but that was a typo by me). I also have the correct translations set up. But 
when I try:

http://www.example.com/admin

It throws an exception stating: 'Invalid controller specified (admin)'. Any 
idea of what I might have overlooked?

Cheers.




> Date: Thu, 12 Mar 2009 19:12:04 +0100
> From: m...@dasprids.de
> To: fw-general@lists.zend.com
> Subject: Re: [fw-general] Zend_Controller_Router_Route & Zend_Translate?
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Pretty simple, you would make your route look like this:
> 
> :@controller/:@action or :@module/:@controller/:@action
> 
> But really copying the module-route by this is not possible. I suggest
> you to create one route per action as usual. And personally, I wouldn't
> use translatable routes in the administration, as SEO-urls are not
> important there.
> 
> Regards,
> Ben
> ...................................
> :  ___   _   ___ ___ ___ _ ___    :
> : |   \ /_\ / __| _ \ _ (_)   \   :
> : | |) / _ \\__ \  _/   / | |) |  :
> : |___/_/:\_\___/_| |_|_\_|___/   :
> :........:........................:
> : Web    : http://www.dasprids.de :
> : E-mail : m...@dasprids.de       :
> : Jabber : jab...@dasprids.de     :
> : ICQ    : 105677955              :
> :........:........................:
> 
> 
> fire-eyed-...@hotmail.com schrieb:
> > 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: fire-eyed-...@hotmail.com
> > To: fw-general@lists.zend.com
> > 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: m...@dasprids.de
> >> To: fw-general@lists.zend.com
> >> 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 : m...@dasprids.de :
> > : Jabber : jab...@dasprids.de :
> > : ICQ : 105677955 :
> > :........:........................:
> > 
> > 
> > fire-eyed-...@hotmail.com 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>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> 
> iEYEARECAAYFAkm5UHAACgkQ0HfT5Ws789AS2wCff12NSz7tAsDO8uEAwk5JY0a9
> EQQAn25wXKE6uwmdTE1/U3xrGvqDkGHi
> =r4xA
> -----END PGP SIGNATURE-----

_________________________________________________________________
Jouw nieuws en entertainment, vind je op MSN.nl!
http://nl.msn.com/

Reply via email to