Posts

Showing posts from April, 2012

CakePHP 2.x : Bake in Ubuntu

Image
Before we bake, you should have finished installing CakePHP and created your database. 1. Open your terminal. You must change your directory to your cake. Type:           cd /var/www/cakefolder/app           Console/cake bake Your CakePHP v2.x Console will display. Next process is the same with CakePHP 1.3, follow step 4 here .

Install CakePHP 2.x in Ubuntu

Image
 Requirements: HTTP Server. For example: Apache. mod_rewrite is preferred, but by no means required. PHP 5.2.8 or greater. Download CakePHP 2.x at their website: http://cakephp.org/ Extract your downloaded file. Copy and paste the contents of the Cake archive in /var/www/cakephp Make it writable, open your terminal and type: sudo chmod 777 -R /var/www/cakephp Create database. Goto /var/www/cakephp/app/Config/ and rename your database.php.default to database.php. Open database.php, then just replace the values in the $default array with those that apply to your setup. . A sample completed configuration array might look something like the following: <?php public $default = array ( 'datasource' => 'Database/Mysql' , 'persistent' => false , 'host' => 'localhost' , 'port' => '' , 'login' => 'DatabaseUsername' , 'password' ...

CakePHP 1.3 : Bake in Ubuntu

Image
Before we bake, you should finished installing CakePHP and created your database. 1. Open your terminal. You must change your directory to your cake. 2. To open cake type: 3. Supply your password. 4. Whoola! This is your CakePHP Console.   5. The first thing we should bake is the Model. Type m then hit enter. We will use default database config so hit enter again. 6. The tables name of your database will be displayed. In CakePHP table name must end with ” s “. We will choose users. 7. I will pass displayfield and validation here, but you may explore it. Since my users table is associated with other table I type ” y “. My model users already exist and was detected by the CakePHP and so I just overwrite it. 8.  Next, lets bake Controller.  Type in ” c ” then hit enter. We will use default database config. 9. We will use users table again. If you like to build your user controller at one time (index(), add(), edit(), delete()), don’t...