Introduction and installation of cakePHP

Introduction and installation of cakePHP

Hi, This is my first post for cakePHP.CakePHP is framework that makes building web applications simpler, faster and require less code.

Here how we use it.(this post is for 1.2.x,1.3.x)
Download CakePHP

unzip the package to root folder.

setp to installation
1) Create a database

2) Edit database setting (rename following file to database.php)
Path: app/config/database.php.default

var $default = array('driver' => 'mysql',
'persistent' => false,
'host' => 'localhost',
'login' => 'username',
'password' => 'password',
'database' => 'datapasename',
'prefix' => '');

3) edit core file (app/config/core.php),Change the value of security.salt

Configure::write('Security.salt', 'DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi');

4)Create a app controller file (app/app_controller.php)

class AppController extends Controller
var $helpers = array('Form','Html','Javascript');
var $components = array();

function beforeFilter()


5) Create pages controller (app/controllers/pages_controller.php)

class PagesController extends AppController
var $name = 'Pages';
var $uses = array();
var $components = array();
function display()


6) Create layout (app/view/pages/layout/default.ctp)

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="">
<title><?php echo $title_for_layout?></title>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<!-- Include external files and scripts here (See HTML helper for more info.) -->
<?php echo $scripts_for_layout ?>

<!-- If you'd like some sort of menu to
show up on all of your views, include it here -->
<div id="header">
<div id="menu">...</div>

<!-- Here's where I want my views to be displayed -->
<?php echo $content_for_layout ?>

<!-- Add a footer to each displayed page -->
<div id="footer">...</div>


7) Create view for page (app/view/pages/display.ctp)

<h3>Welcome</h3><br />
<p>This is display page.</p>

8)Installation complete ! Enjoy

Atul Kumar

Be the first to comment “Introduction and installation of cakePHP”

Time limit is exhausted. Please reload CAPTCHA.