Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Use of $this->set() in Cakephp

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 138
    Comment on it

    Hello Readers ,

    In cakephp development framework we will use $this->set() several times .

    The set() method is basically use to create a variable in our view file i.e. ctp file .

    If suppose we have an array $userprofile and we want to use this in our ctp file then we will use like this way.

    $this->set('userprofile',$userprofile);
    

    or we can also write in this way

    $this->set('result',$userprofile);
    

    the variable $userprofile or $result will then be available to use in the view template file for that action.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: