Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • cakePHP Flash component

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 210
    Comment on it

    cakePHP have by default FlashComponent which provides  notification messages to be displayed in the website or application after processing a form .

    FlashComponent in cakePHP writes flash messages  to be rendered in a ctp file in view folder .

    Setting Flash Messages

    FlashComponent provides two ways to set flash messages: its call magic method and its set() method.

    We use the set() method to use  flash message handler.

    the syntax for showing the flash messages is- >

    $this->Flash->set('This is a message');

    We can create our custom Flash elements too. , FlashComponent call magic method allows you use a method name that maps to an element located under the app/View/Elements/Flash directory.

     

    // Uses app/View/Elements/Flash/one.ctp
    $this->Flash->one('This was good');
    
    // Uses app/View/Elements/Flash/two.ctp
    $this->Flash->two('This was very good');
    

 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: