Cakephp Step By Step Tutorial: We still wok with our first application at cakephp. But we will build controller and view better. Create parameters in controller and send it to view. It will make our application more flexible.
Create a new file books_controller.php within D:\xampp\htdocs\cakephp\app\controllers. Overwrite become like this:
<?php
class BooksController extends AppController {
var $Books = 'Books';
var $uses=null;
function index() {
$this->set('page_heading', 'Packt Book Store');
$book = array (
'book_title' => 'Object Oriented Programming
with PHP5',
'author' => 'Hasin Hayder',
'isbn' => '1847192564',
'release_date' => 'December 2007'
);
$this->set($book);
$this->pageTitle = 'Welcome to the Packt Book Store!';
}
}
?>

Now create a folder books in side D:\xampp\htdocs\cakephp\app\views
And inside books create a file index.ctp. Rewrite with following code:
<h2><?php echo $page_heading; ?></h2>
<dl>
<lh><?php echo $book_title; ?></lh>
<dt>Author:</dt><dd><?php echo $author; ?></dd>
<dt>ISBN:</dt><dd><?php echo $isbn; ?></dd>
<dt>Release Date:</dt><dd><?php echo $release_date; ?></dd>
</dl>



