Archive | HowTo RSS feed for this section

[CakePHP] Back port Helper aliasing to CakePHP 1.2 and 1.3

TweetOne of the enticing new features of CakePHP 2 is Aliasing. What do you do if you need aliasing in CakePHP 1.2 or 1.3? Here is a guide to back port aliasing for helpers. For this guide we will overwrite HTML helper's link method to always avoid escaping of the title. To start with you [...]

Read full story · Comments { 4 }

[CakePHP] Saving HABTM data with tables in different databases

TweetOne of the powerful features of CakePHP is the model relationships. It handles relationships seamlessly and saves/finds data of related models on its own. The most complex among the relationship is the Has And Belongs To Many, often shortened as HABTM Recently I faced a problem in saving data for a HABTM model. The problem [...]

Read full story · Comments { 2 }

[CakePHP] How to show ‘all’ records options while still using paginate

TweetAdmittedly this is a marginal case but recently a client wanted to show "All" records along with a list of 'per page' options for paginated records, for example, something like '2, 5, 10, 25, 50, 100, All' or you need to use 'field sort' feature of pagination while displaying all records. So, following is a [...]

Read full story · Comments { 2 }

[HowTo] Page expire on browser back/reload in CakePHP

TweetYou might have seen this on many banking sites that the navigation has to be done only via the links and buttons provided on the webpage and if a user clicks the browser's back or reload button, it shows a page expired error. Let's see how it can be done in CakePHP. We will set [...]

Read full story · Comments { 2 }