本文整理汇总了PHP中AdminBaseController::populateView方法的典型用法代码示例。如果您正苦于以下问题:PHP AdminBaseController::populateView方法的具体用法?PHP AdminBaseController::populateView怎么用?PHP AdminBaseController::populateView使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AdminBaseController
的用法示例。
在下文中一共展示了AdminBaseController::populateView方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
Route::get('preview-list', array('as' => 'previewList', 'uses' => 'ListController@previewList'));
//My profile
Route::get('me', array('as' => 'myProfile', 'uses' => 'UserController@myProfile'));
Route::match(array('get', 'post'), 'me/settings', array('as' => 'myProfileSettings', 'uses' => 'UserController@myProfileSettings'));
});
Route::get('pages/{nameString}.html', array('as' => 'viewPage', 'uses' => 'PageController@viewPage'));
Route::get('category/{slug}', array('as' => 'category', 'uses' => 'ListController@category'));
$admin = Session::get('admin');
View::share('loggedInAdmin', $admin);
App::singleton('loggedInAdmin', function () use($admin) {
return $admin;
});
Route::filter('adminAuth', function () {
$admin = Session::get('admin');
//Populate view with common data for admins
AdminBaseController::populateView();
/*if (!$admin && !Input::get('logmein'))
{
return Response::notFound();
} else */
if (!$admin) {
if (Request::ajax()) {
return Response::make('You have been logged out or your session has expired. Please login on another tab and try again.<br><br><a target="_blank" href="' . route('adminLogin') . '" class="btn btn-success">Login again</a></a>', 400);
} else {
return Redirect::route('adminLogin', ['redirect' => urlencode(Request::path())]);
}
}
});
Route::match(array('get', 'post'), 'admin/login', array('as' => 'adminLogin', 'uses' => 'AdminController@login'));
Route::get('admin/logout', array('as' => 'adminLogout', 'uses' => 'AdminController@logout'));
Route::group(array('before' => 'adminAuth'), function () {