Posts Tagged ‘cakephp’

Posts Tagged ‘cakephp’


CakePHP Locale and Routing

7.31.2012 | 2 Comments

CakePHP

When I was working on the cakephp localization ( l10n ) and internationalization ( i18n ), I came across a problem so I decided to let the world know about it if anyone had got the same issue.

What we want here is that a user can go to the localized version of the website according to the URL identified, for instance we want the website to load the English locale when we pass a URL like this http://example.tld/eng/Controller/Action

The problem is that while implementing the routes for the language detection, the plugins made a conflict with the rules in the routes file. Language routing is easy but sometimes can be tricky.
Read more…


Cakephp: Force SSL on certain actions

3.15.2012 | 6 Comments

After going here and there and implementing alot of solutions, I found that every post request is getting redirected to get even if it was with HTTPS because of the implementation of the ForceSSL in the manual, so my word to you, save your time and implement this simple solution. I have tested it on cakephp 2.0 however I think it wouldn’t mind to work on cakephp 1.3
Read more…


Cakephp: Pagination sorting from foreign fields (fields from associated models)

3.06.2012 | 1 Comment

I came across a problem while developing with cakephp 2.0.

Suppose that you have got a Post model and a Category model, and you have a grid, with all posts and the category title they belong to. In order to sort by the category title you will need to do as the following in your view.

echo $this->Paginator->sort('Category.title','labelForTheTableHeader');

Hope that helps anyone
Cheers