Created
May 5, 2015 11:22
-
-
Save anonymous/5f9b2f12092359f2edbc to your computer and use it in GitHub Desktop.
I'am trying to localize my website. majordog.fr/fr_FR/Users/login (majordog.fr/fr_FR/users/login not workin, this is my bug)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Cake\Core\Plugin; | |
use Cake\Routing\Router; | |
Router::defaultRouteClass('Route'); | |
Router::scope('/', function ($routes) { | |
$languageCodes = array('language' => 'fr_FR|pt_BR'); | |
$routes->connect('/', ['controller' => 'Pages', 'action' => 'display', 'home']); | |
$routes->connect('/pages/*', ['controller' => 'Pages', 'action' => 'display']); | |
$routes->connect('/:language', array('controller' => 'Pages', 'action' => 'display', 'home'), $languageCodes); | |
$routes->connect('/', array('controller' => 'Pages', 'action' => 'display', 'home')); | |
$routes->connect('/:language', array('controller' => 'Pages', 'action' => 'display', 'home'), $languageCodes); | |
$routes->connect('/:language/pages/*', array('controller' => 'Pages', 'action' => 'display'), $languageCodes); | |
$routes->connect('/:language/:controller/:action/*', array(), $languageCodes); | |
$routes->connect('/:language/:controller', array('action' => 'index'), $languageCodes); | |
$routes->fallbacks('InflectedRoute'); | |
}); | |
Plugin::routes(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment