Posted on November 29, 2007 by ragrawal
Recently, I felt the need to make my CakePHP based controllers independent of how parameters are sent. For instance, in Memento, I can handle parameters sent either in traditional way or using CakePHP style or even using the form (see usage below)
Example (see how owner value is sent differently in the URL below)
Traditional Way: http://www.findnwrite.com/memento/articles_users/library/?owner=2
CakePHP way: http://findnwrite.com/memento/articles_users/library/owner:2
To make my controllers [...]
Filed under: CakePHP | Tagged: Controller | 1 Comment »
Posted on November 23, 2007 by ragrawal
Last month I posted a PHP script to find all the blank spaces before and after PHP opening (<?php ) and closing tag ( ?>). The script works nicely, but it only identifies files having blank spaces or lines before or after PHP tag. It does not remove them.
Luckily, I came across a google group discussion [...]
Filed under: PHP | Tagged: Blank Spaces, Script | 3 Comments »
Posted on November 7, 2007 by ragrawal
For last four days, I have been trying to get a valid RSS output using CakePHP. Everything was working fine, except that there were some blank spaces before RSS declaration. Because of this, none of the browsers were recognizing cakephp output as RSS feed. The problem was simple; I left blank spaces and few new lines before and after PHP [...]
Filed under: PHP | 11 Comments »
Posted on November 3, 2007 by ragrawal
This week, I learnt many new tricks in CakePHP. Below are some of them
1. Get current URL in the view (Thanks to Grant Cox for this one) :
Use Router::url(“”, true) to get current URL in the view. The second boolean parameter tells whether the path should be absolute or relative. Ideally Router::url(“”, true) should return an [...]
Filed under: CakePHP | 4 Comments »