zen of coding

How to build a "dashboard" for your application in CakePHP

As an addition to my recent post, I wanted to share a technique, which should allow you to pretty easily build a “dashboard” for your app. The dashboard would basically grab some information from a few different models and display it all on one page. First, let’s go over some[…]

Read More »

How to build a “dashboard” for your application in CakePHP

As an addition to my recent post, I wanted to share a technique, which should allow you to pretty easily build a “dashboard” for your app. The dashboard would basically grab some information from a few different models and display it all on one page. First, let’s go over some[…]

Read More »

A little note about the new line character, Ajax and a silly mistake…

Just something “fun” to share on Friday… I had a simple Ajax auto-complete type of widget in my app… which ultimately returned this view: [cc lang=”html”] if(!empty($items)) { foreach($items as $key => $item) { echo $item . ‘\n’; } } [/cc] Everything worked well, except that \n was not treated[…]

Read More »

CakePHP and Aptana Cloud = Love at First Sight

Before I write a post, I usually test the code I write about… and try to copy/paste it the best I can… so I don’t look like an ass later on. This post, however, I simply cannot prepare for… I’m just way too excited (yes, even more than Pacquiao’s dismantling[…]

Read More »

CakePHP URL-based language switching for i18n and l10n (internationalization and localization)

Update (08/03/2012): Dorin M. has refactored this solution for 2.x series, look for the code here. For details of what’s going on, read on below. ———– I should preface this post by saying that it does not cover the basics of i18n and l10n so, please, first take a look[…]

Read More »

Changing model's table from the controller

For one reason, or another you might wish to change your Model’s table on the fly… It would seem that it should be quite easy to do with: $this->Company->useTable = ‘another_company_table’; …but it’s not going to work… Instead, in your controller, use: $this->Company->table = ‘another_company_table’; I haven’t checked to see[…]

Read More »

Get yourself a new home (alternative to home.ctp)

I’m sure you know that to modify your application’s homepage, one needs to edit/create the home.ctp file in app/views/pages/home.ctp. That, however, leaves you dealing with a more or less static page… One common option to add some other functionality to your otherwise static pages is to copy the Pages Controller[…]

Read More »

A little something about the Form Helper…

Just a quick pointer about the form helper usage… If you don’t like the default output of $form->input(); [cc lang=”html”] echo $form->input(‘SomeModel.some_field’); //which produces: Some Field [/cc] Mainly the div’s, it produces, you can of course turn them off by using: [cc lang=”html”] echo $form->input(‘SomeModel.some_field’, array(‘div’=>false)); //which produces: Some Field[…]

Read More »

Clearing up some confusion regarding the Security component

In the previous post, I’ve made a little “mistake” (if you wish to call it that) in the way I’ve setup the Security component… So, here I’d like to shed some light on the way things really work. This is the code I’ve been using in the past and…, I[…]

Read More »
%d bloggers like this: