mirror of
https://github.com/Oreolek/kohana-multilang.git
synced 2024-05-04 10:08:17 +03:00
Bug in Readme.md
This commit is contained in:
parent
d4e7d8d246
commit
c754d49fed
20
README.md
20
README.md
|
@ -55,15 +55,15 @@ If you try to access `http://www.domain.tld/`, the module will redirect it to `h
|
||||||
|
|
||||||
Let's say we have a product page, with kohana 3 we'd have something like :
|
Let's say we have a product page, with kohana 3 we'd have something like :
|
||||||
|
|
||||||
Route::set('product.details', 'products/<product_id>-<product_slug>', array(
|
Route::set('product.details', 'products/<product_id>-<product_slug>', array(
|
||||||
'product_id' => '[0-9]+',
|
'product_id' => '[0-9]+',
|
||||||
'product_slug' => '.+',
|
'product_slug' => '.+',
|
||||||
))->defaults(array(
|
))->defaults(array(
|
||||||
'controller' => 'Product',
|
'controller' => 'Product',
|
||||||
'action' => 'details',
|
'action' => 'details',
|
||||||
'product_id' => NULL,
|
'product_id' => NULL,
|
||||||
'product_slug' => '',
|
'product_slug' => '',
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -118,4 +118,4 @@ If you have any suggestions, found a bug or anything, feel free to share.
|
||||||
|
|
||||||
We change the Request to force the detection of a language on the site root. Then if a route is found, we get the language from it with its 'lang' parameter and we initialize.
|
We change the Request to force the detection of a language on the site root. Then if a route is found, we get the language from it with its 'lang' parameter and we initialize.
|
||||||
Each route created with a language code gets another parameter: `lang`. A uri like `products/details` will become `<lang>/products/details`.
|
Each route created with a language code gets another parameter: `lang`. A uri like `products/details` will become `<lang>/products/details`.
|
||||||
But since every multilingual route is unique (except default), the regex part allows only one language code. So we have `array('lang' => 'en')` instead of having something like `array('lang' => '(en|fr|de')`. We could have directly the language code in the uri like `en/products/details` but the lang parameter allows us to easily retrieve the route language and works better with the default route.
|
But since every multilingual route is unique (except default), the regex part allows only one language code. So we have `array('lang' => 'en')` instead of having something like `array('lang' => '(en|fr|de')`. We could have directly the language code in the uri like `en/products/details` but the lang parameter allows us to easily retrieve the route language and works better with the default route.
|
||||||
|
|
Loading…
Reference in a new issue