为什么我的刀片有Undefined Variable - Laravel 4.2
问题描述:
This is on my routes.php
Route::get('registration/verify/{confirmation}', ['as'=>'verify', 'uses'=>'HomeController@verify']);
Route::get('login', ['as'=>'login', 'uses'=>'HomeController@getLogin']);
and on my blade is this
then on my HomeController.php
where the error belong
public function verify($confirmation)
{
$user = User::where('activation_code', '=', $confirmation)->first();
return Redirect::route('login')
->withInput(['email' => $user->email])
->with('fuck', 'wtf');
}
and I got error like this
Undefined variable: fuck (View: C:\Program Files (x86)\Ampps\www\tridg\local\app\views\auth\login.blade.php)
I don't know where I been wrong, I'm so confident that this is correct.
EDIT1:
I even tried this
public function verify($confirmation)
{
$user = User::where('activation_code', '=', $confirmation)->first();
// $user->active = 1;
// $user->save();
return Redirect::route('login', ['fuck'=>'wtf'])
->withInput(['email' => $user->email]);
}
答
Nevermind, The answer is {{ Session::get('var_name') }}
not {{ $var_name }}