For /post/index/en, you will get 'en' as PostsController::index() method's first argument and then you can set the language using the code something like
class PostsController extends AppController
{
function index($locale = 'en')
{
Configure::write('Config.language', $locale);
$data = $this->Post->find('all');
}
}
Amit Badkas
PHP Applications for E-Biz: http://www.sanisoft.com
On Thu, Nov 25, 2010 at 9:42 AM, hoss7 <hossbit@gmail.com> wrote:
how can i read url for select one language content from database?
http://localhost/en/post/index
or
http://localhost/post/index/en
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
No comments:
Post a Comment