Using Virtual Fields in CakePhp

September 6th, 2010 | CakePhp

Virtual fields in cakephp are used as an alias in sql expressions. Alias is used to give a column a different name.

Example, to concatenate fields,

class Applicant extends AppModel {
    var $name = 'Applicant';
    var $virtualFields = array( 'name' => "CONCAT(Applicant.firstname, ' ', Applicant.lastname)" );
}

To access the virtual field

$this->Applicant->find( 'first', array( 'fields' => array( 'name' ) ) );

Fx.slide using Mootools and CakePhp

June 1st, 2010 | Mootools

Using Fx.slide in Cakephp is very easy. In this tutorial, I assume you know how the MVC works and how to create one.

First, include the javascript in the head section of the default.ctp file. There are only two javascript files. They are the mootools.js( core ) and slider.js. Put these files inside /app/webroot/js.

Read more…