Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Is There Any Built-In Solution to Show Notification Messages?
  • Hey, I'm two steps from finishing my a11n package! =) There are just few things I need to finish/improve. Is there any built-in solution for showing notification messages? For example, before I did like this...
    ...
    
    } else {
    
      $this->output = 'Given data aren\'t valid!';
    
    }
    

    It seems it don't work anymore (I have latest branch from GitHub) and, anyways, it's definitely not the right way. So what do you suggest?
  • Assuming you want a message to only show for a single page request, the session class's flash functionality could be what you're looking for. See set_flash and get_flash here: http://fuelphp.com/docs/classes/session/usage.html
  • We've removed the output class and replaced it with the Response class, this means that to create the output you no longer use $this->output in your controller but instead:
    // add to the current body
    $this->response->body .= 'something';
    
    // or use the function to replace the entire body
    $this->response->body('something');
    

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion