There is some solution for using CakePHP route with params only when are not empty?
Now I code below, but I would like some better:
if(Configure::read(\'
Ok, these things work better, but I still other problem.
I set default language by Configure::write('Config.language');
to en in bootstrap.php
Next i wrote shema for url like this:
Router::connect('/:language/'. __('register', true), array('controller' => 'users', 'action' => 'register'), array('persist' => array('lang')));
Router::connect('/'. __('register', true), array('controller' => 'users', 'action' => 'register'));
And when users change language by beforeFilter in AppController (set new Config.language) will content from static .po and db worsk perfeclty, but links not translated.
Parametr :language
works but magic function __()
in Router:connect()
not works.
Because first loaded is bootstrap.php, next is router.php and last is AppController.php
My question is, how to force router.php to translate links (__()
)?
Sorry, but still learn english...