当前位置: 首页>>代码示例>>PHP>>正文


PHP MenuItem::all方法代码示例

本文整理汇总了PHP中MenuItem::all方法的典型用法代码示例。如果您正苦于以下问题:PHP MenuItem::all方法的具体用法?PHP MenuItem::all怎么用?PHP MenuItem::all使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MenuItem的用法示例。


在下文中一共展示了MenuItem::all方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: dashBoard

 public function dashBoard()
 {
     $menu_items = \MenuItem::all();
     $categories = \MenuCategory::all();
     if (\Auth::check()) {
         return \View::make('admin.dashboard')->with('menu_items', $menu_items)->with('categories', $categories);
     }
     return \View::make('accounts.login');
 }
开发者ID:adamyWA,项目名称:Menu-CMS,代码行数:9,代码来源:Dashboard.php

示例2: checkLogin

 public function checkLogin()
 {
     $username = \Input::get('username');
     $password = \Input::get('password');
     $validator = new Validate();
     $validated = $validator->validateCreds();
     $attempt = \Auth::attempt(array('username' => $username, 'password' => $password));
     $menu_items = \MenuItem::all();
     $categories = \MenuCategory::all();
     if ($validated->passes()) {
         if (!\Auth::validate(array('username' => $username, 'password' => $password))) {
             return \View::make('accounts.login')->withErrors($validated)->withInput(\Input::only('username'))->with('message', '<p class="alert alert-dismissible alert-danger">Invalid username or password</p>');
         }
         if ($attempt === true) {
             return \View::make('admin.dashboard')->with('menu_items', $menu_items)->with('categories', $categories);
         }
     }
     return \View::make('accounts.login')->withErrors($validated)->withInput(\Input::only('username'));
 }
开发者ID:adamyWA,项目名称:Menu-CMS,代码行数:19,代码来源:CheckLogin.php

示例3: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $menuItems = MenuItem::all();
     $this->layout->title = 'Menu';
     $this->layout->main = View::make('dash')->nest('content', 'menu.index', compact('menuItems'));
 }
开发者ID:jeremy6680,项目名称:easy-peasy-cms,代码行数:11,代码来源:MenuItemController.php

示例4: function

Route::filter('auth', function()
{
    if (Auth::guest()) return Redirect::guest('auth/login');
});
*/
Route::controller('password', 'RemindersController');
/* tests ci-dessous */
Route::controller('users', 'UsersController');
Route::get('login', ['as' => 'login', 'uses' => 'AuthController@getLogin']);
Route::get('logout', ['as' => 'logout', 'uses' => 'AuthController@getLogout']);
Route::post('/post/{post}/comment', ['as' => 'comment.new', 'uses' => 'CommentController@newComment']);
View::composer('sidebar', function ($view) {
    $view->recentPosts = Post::orderBy('id', 'desc')->take(5)->get();
});
View::composer('menu', function ($view) {
    $view->menuItems = MenuItem::all();
});
/* Model Bindings */
Route::model('post', 'Post');
Route::model('comment', 'Comment');
Route::model('pages', 'Page');
Route::model('menuItem', 'MenuItem');
Route::model('user', 'User');
Route::model('page', 'Page');
// ===============================================
// ADMIN SECTION =================================
// ===============================================
/* Admin routes */
Route::group(['prefix' => 'admin', 'before' => 'auth'], function () {
    /*get routes*/
    Route::get('/', array('as' => 'admin', function () {
开发者ID:jeremy6680,项目名称:easy-peasy-cms,代码行数:31,代码来源:routes.php


注:本文中的MenuItem::all方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。