php - Pass variable to template on redirect - Laravel4 -


i try pass variable template class, on redirect, if try access variable on template, give error:

[2013-08-07 22:24:47] log.error: exception 'errorexception' message 'undefined variable: message' in 

this actual code:

try {     $loginresult = sentry::authenticate($datas, (input::get('remember') ? true : false));      if($loginresult) {         return redirect::to('home')->with('message', array('successmessage' =>lang::get('account.login.success'), ));     } } catch(exception $e) {     log::getmonolog()->warning($e->getmessage()); } 

and template part:

@if( $message->successmessage )     {{ $message->successmessage }} @endif 

what wrong? answers.

from laravel documentation, http://four.laravel.com/docs/responses probably, 'message' going array flash data. so, in view can try :

<?php  $array = session::get('message'); echo $array['successmessage'];  ?> 

and let me know if works?


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -