1.

What Is The Use Of $this->set();

Answer»

The set() method is used for CREATING a variable in the view file.Say for example if we write,

$this->set('POSTS',$posts); in CONTROLLER fie, then the variable $posts will be available to use in the view TEMPLATE file for that action.

The set() method is used for creating a variable in the view file.Say for example if we write,

$this->set('posts',$posts); in controller fie, then the variable $posts will be available to use in the view template file for that action.



Discussion

No Comment Found