If knowledge is power, then sharing knowledge is ultimate powertrip
Latest Updates
You are here: Home >> Frameworks

Frameworks

Feed Subscription

Access model from controller

access_model_controller

Sometimes, or very rarely we might need to access model from controller or AppController (Application Controller). This could be for fetching values from a table and make it available for all the controllers in the application (AppController is inherited by all the other controllers). Also, often we need to access models that are not associated with a controller. I faced ... Read More »

Self join in CakePHP

I tried to explain how to do a self join in CakePHP I use this in my Gallery Model: var $hasMany = array( ‘Galleries’ => array( ‘className’ => ‘Gallery’, ‘order’ => ‘Galleries.ord ASC’, ‘foreignKey’ => ‘parent_id’)); var $belongsTo = array( ‘Galleries’ => array( ‘className’ => ‘Gallery’, ‘order’ => ‘Galleries.ord ASC’, ‘foreignKey’ => ‘parent_id’)); First, note the ‘Galleries’ (you change that ... Read More »

cakephp include javascript file in view

You probably know that if you have $scripts_for_layout in your site’s layout, then you can do a Cakephp include javascript file in view. For example, if you’d like to include ‘myScript.js’ from some view you would add the following code: $javascript->link(‘myScript’, false); Basically the second param (false), will tell CakePHP not to include the file in-line, but rather where the ... Read More »

CakePHP email handler

CakePhp email handler ’emailComponent’ (cakelibscontrollercomponentsemail.php) is a way for you to using the same concepts of layouts and view ctp files to send formatted messages as text, html or both. It supports sending via the built in mail functions of PHP, via smtp server or a debug mode where it writes the message out to a session flash message. It ... Read More »

Opening Cake THTML file with Dreaweaver CS4

Just go to: C:Program FilesAdobeAdobe Dreamweaver CS4configuration Open file: Extensions.txt edit line 16 and add THTML Save and Close the File Next, Open MMDocumentTypes.xml at C:Program FilesAdobeAdobe Dreamweaver CS4configurationDocumentTypes Add THTML online 75 : winfileextension=”thtml,php,php3,php4,php5″ macfileextension=”thtml,php,php3,php4,php5″ Save, close and Restart Dreamweaver! For more Info :- http://keithics.com/blog/article/opening-cake-thtml-file-with-dreaweaver-cs4/118/ Thanks Jawed Read More »

Pagination in codeigniter

I’ve often see forum posts asking why the Pagination class isn’t working. I decided to create a tutorial on the Pagination class for those who need to learn about the pagination class. Let’s now start with the pagination tutorial. This tutorial assumes that you have connected your CodeIgniter application to the database. First, we need to create a table. [crayon-56e64255a4e71527841204/] ... Read More »

Scroll To Top