Edit the controller

and see the output.. well it’s kinda fun
a little..
<?php
class ProductsController extends AppController
{
  var $name = “Products”;
  function index()  {
    $Data = $this->Product->find(‘all’);
    $this->set(‘Data’, $Data);
  }}
?>

** fun changing.. **

when i change  ProductsController into something else it’s produce error
Error: ProductsController could not be found
when i change index() into something else.. it’s produce error…??
 Error: The action index is not defined in controller
when i change var name= “Products” into “Produ” it’s says
 Error: Database table produ for model Produ was not found.
when i change $this->set(‘Data’, $Data); into  $this->set(‘Datas’, $Data);
 Error:Undefined variable: Data [APP\views\products\index.ctp, line 2]..hmmm
when i change $Data = $this->Product->find(‘all’); into $Data = $this->Produ->find(‘all’);
 whoaa.. produce mass error on screen…

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.