I would have had less routes if the default values were working like it is
suggested in the manual.
E.g.
Zend_Controller_Router_Route(':lang/:controller/:pageid/*',
array('controller' => 'index'), array('lang' => 'fr|nl|en'));
doesn't catch an URL like:
/fr/services-webmaster (I expected that :controller getting the default
value and :pageid getting services-webmaster)

So I need to create a route for the optional :lang param, for the optional
:module, for the optional :controller, etc.: a nightmare.

>From the manual:
$route = new Zend_Controller_Router_Route(
    ':module/:controller/:action/*',
    array('module' => 'default')
);
$router->addRoute('default', $route);
The :module param taking the default value "default" when ommitted ... well
I tried but no results ...



debussy007 wrote:
> 
> My CMS allows the user to define custom URLs or to leave the default ZF
> URL system for a specific page. Also the URL usually includes the language
> /fr/, /en/, etc. and if there is none, it's the default locale that will
> be taken.
> 
> -> custom url
> 
> 1. ':pageid/*' 
> (user rewrites the whole url module/controller/action to a custom one, use
> the default language)
> 2. ':lang/:pageid/*' 
> (user rewrites the whole url module/controller/action to a custom one and
> also specifies the language)
> 3. ':controller/:pageid/*'
> (user rewrites the action to a custom one, use the default language)
> 4. ':lang/:controller/:pageid/*'
> (user rewrites the action to a custom one and specifies language)
> 5. ':module/:controller/:pageid/*'
> (user rewrites the action to a custom one, use the default language)
> 6. ':lang/:module/:controller/:pageid/*'
> (user rewrites the action to a custom one and specifies language)
> 
> ->default url
> 
> 7. ':lang/:controller/:action/*'
> 8. ':lang/:module/:controller/:action/*'
> 9. the default ZF module route
> 
> I am a psycho ?  :)
> I just want to allow a large flexibility regarding the format of the URLs
> for each page.
> 
> 
> 
> 
> 
> DASPRiD wrote:
>> 
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>> 
>> debussy007 wrote on 12.08.2009 18:59:
>>> Hi,
>>> 
>>> I defined 8 custom routers in my bootstrap, including the default router
>>> that makes it 9 routers.
>>> For every request, it will check the routers one by one as long as one
>>> didn't match. Thus I wondered if I have to worry about performances for
>>> e.g.
>>> the URLs matching the last checked route or if it is insignificant. I
>>> have
>>> no idea.
>>> 
>>> Thank you for any help.
>> 
>> For what the hell do you need 9 different routers?
>> 
>> - --
>> ...................................
>> :  ___   _   ___ ___ ___ _ ___    :
>> : |   \ /_\ / __| _ \ _ (_)   \   :
>> : | |) / _ \\__ \  _/   / | |) |  :
>> : |___/_/:\_\___/_| |_|_\_|___/   :
>> :........:........................:
>> : Web    : http://www.dasprids.de :
>> : E-mail : m...@dasprids.de       :
>> : Jabber : jab...@dasprids.de     :
>> : ICQ    : 105677955              :
>> :........:........................:
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.4.9 (GNU/Linux)
>> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>> 
>> iEYEARECAAYFAkqC+z4ACgkQ0HfT5Ws789CuDgCfQCGbcC6ERIOog02VRA1Smw1p
>> zYoAn0gamcqPH+RrQJ53fm94/U9xPvSl
>> =uzNF
>> -----END PGP SIGNATURE-----
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/8-custom-routers-...-should-I-worry-about-performance---tp24940719p24943305.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to