About Amit Badkas

Amit Badkas is Zend certified PHP5 and Zend Framework engineer, and has been working in SANIsoft for past 9 years, his present designation is 'Technical Manager'
Author Archive | Amit Badkas

[CakePHP] Tweak translate behavior get belongsTo translations

TweetIn one of my earlier posts, I had written about How to fallback to default language while using Translate behavior. This is one more Translate behavior tweak (in continuation with the previous) to get belongsTo data's translations in current locale. By default, Translate behavior only gets current model's translations in current locale and you need [...]

Read full story · Comments { 1 }

How to track SQL errors in CakePHP on production site

TweetIn a CakePHP application, if there is any SQL error and debug level is set to greater than 0, then the complete error message from the database is displayed on the screen, but if the debug is set to 0 it just gives something like "unable to add" or worse a blank page. This can [...]

Read full story · Comments { 3 }

[CakePHP] Pagination options persistence

TweetEditing a record and redirecting to a paginated list is a very common workflow pattern in CakePHP. However there is a small problem with this pattern if used with default pagination. after editing the user is always returned to to the first page with the default order and default limit. This is not very user [...]

Read full story · Comments { 2 }

[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 }