I\'ve written a simple display_messages()
function that will search Session::get(\'errors\')
for flash data and echo it to the screen.
Where do
Create app/libraries/class/Message.php
, and add class in file
class Message {
public static function display() {
}
}
Add "app/libraries/class"
to composer.json
"autoload": {
"classmap": [
"app/commands",
"app/controllers",
"app/models",
"app/database/migrations",
"app/database/seeds",
"app/tests/TestCase.php",
"app/libraries/class"
]
},
Finally run composer dump-autoload
in command line.
You can access that by Message::display()
Create app/libraries/function/display_messages.php
, and add function in file
function display_messages() {
}
add one line in start/global.php
require app_path().'/libraries/function/display_messages.php';
You can access that just by display_messages()