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


PHP Page::all方法代码示例

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


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

示例1: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $pagesAll = Page::all();
     $articlesAll = Article::all();
     $templatesAll = Template::all();
     $contentAreasAll = ContentArea::all();
     $content_areas = ContentArea::lists('name', 'id');
     $pages = Page::lists('name', 'id');
     $article = Article::findOrFail($id);
     return view('site.edit', compact('article', 'pages', 'content_areas', 'pagesAll', 'articlesAll', 'templatesAll', 'contentAreasAll'));
 }
开发者ID:chrismoulins,项目名称:Laravel,代码行数:17,代码来源:SiteController.php

示例2: index

 public function index()
 {
     $pages = Page::all();
     $landing = Landing::where('lang', \App::getLocale())->first();
     $universities = University::where('lang', \App::getLocale())->take(9)->get();
     return view('pages.index', ['pages' => $pages, 'landing' => $landing, 'universities' => $universities]);
 }
开发者ID:AbuLoot,项目名称:unichina,代码行数:7,代码来源:PagesController.php

示例3: boot

 /**
  * Bootstrap any application services.
  *
  * @return void
  */
 public function boot()
 {
     $pages = Page::all();
     $cities = City::all();
     view()->share('pages', $pages);
     view()->share('cities', $cities);
 }
开发者ID:AbuLoot,项目名称:vi,代码行数:12,代码来源:AppServiceProvider.php

示例4: index

 public function index()
 {
     // echo Str::slug('test stasd', '_');
     if (\Request::ajax()) {
         return Page::all();
     }
     return view('page.index');
 }
开发者ID:ravuthz,项目名称:cms-laravel5.1,代码行数:8,代码来源:PageController.php

示例5: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     //		return view('Admin')->withPages(Page::all());
     //		return view('Admin',['pages'=>Page::all()]);
     return view('Admin')->with('pages', Page::all())->with('articles', Article::all());
     //		$pages['pages'] = Page::all();
     //		return view('Admin',$pages);
 }
开发者ID:willphper,项目名称:laravel5,代码行数:13,代码来源:AdminController.php

示例6: boot

 /**
  * Bootstrap any application services.
  *
  * @return void
  */
 public function boot()
 {
     view()->composer('_footer', function ($view) {
         $view->with('pages', \App\Page::all());
     });
     view()->composer('errors.404', function ($view) {
         $view->with('products', \App\Product::paginate(12));
     });
 }
开发者ID:nasikgiga,项目名称:onlineshop,代码行数:14,代码来源:AppServiceProvider.php

示例7: index

 /**
  * Show the application dashboard to the user.
  *
  * @return Response
  */
 public function index()
 {
     //return view('home');
     /*$page = Page::findOrFail(12);
     
     		print_r($page);
     		exit();*/
     //echo storage_path();
     return view('adminHome')->withPages(Page::all());
 }
开发者ID:yunyunchen,项目名称:php-laravel,代码行数:15,代码来源:HomeController.php

示例8: map

 /**
  * Define the routes for the application.
  *
  * @param  \Illuminate\Routing\Router  $router
  * @return void
  */
 public function map(Router $router)
 {
     $router->group(['namespace' => $this->namespace], function ($router) {
         require app_path('Http/routes.php');
     });
     foreach (Page::all() as $page) {
         $router->get($page->uri, ['as' => $page->name, function () use($page, $router) {
             return $this->app->call('App\\Http\\Controllers\\PageController@show', ['page' => $page, 'parameters' => $router->current()->parameters()]);
         }]);
     }
 }
开发者ID:nahidex,项目名称:Laravel-CMS,代码行数:17,代码来源:RouteServiceProvider.php

示例9: boot

 /**
  * Bootstrap any application services.
  *
  * @return void
  */
 public function boot()
 {
     //
     if (Schema::hasTable('sections')) {
         $sections = Section::all();
         $pages = Page::all();
         $pagesNew = [];
         $sectionsNew = [];
         view()->share(['sections' => $sections, 'pages' => $pages, 'sectionsNew' => $sectionsNew, 'pagesNew' => $pagesNew]);
     }
 }
开发者ID:kesumu,项目名称:WebComponent,代码行数:16,代码来源:AppServiceProvider.php

示例10: show

 public function show($slug)
 {
     $paths = array_filter(explode('/', $slug));
     $count = count($paths);
     foreach ($paths as $k => $slug) {
         $k++;
         $_p = \App\Page::where('slug', $slug)->first();
         if (!$_p) {
             $pages = \App\Page::all();
             /*foreach($pages as $page) {
                   if($page->translations(lang())->has('slug')) {
                       if($page->translation('slug') == $slug) {
                           $_p = $page;
                       }
                   }
               }*/
         }
         if (!$_p) {
             abort(404);
         }
         /*echo $_p->translations(lang())->get('title').'<br>';
           
           $crumbs[] = [
               'id' => $_p->id,
               'title' => $_p->translations(lang())->get('title'),
               'path' => $_p->path
           ];*/
         if ($_p && $k == $count) {
             $page = $_p;
             $data['page'] = $page;
             $data['seo'] = $page;
             if ($page->hasSubs()) {
                 $data['subs'] = $page->getSubs();
             }
             $data['banner'] = $page['banner'] ?: false;
             //$data['crumbs'] = $crumbs;
             if ($page->blade_view) {
                 return view('frontend.' . $page->blade_view)->with($data);
             }
             return view('frontend.page')->with($data);
         }
     }
 }
开发者ID:stjanilofts,项目名称:lh,代码行数:43,代码来源:PageController.php

示例11: run

 public function run()
 {
     $faker = Faker\Factory::create();
     for ($i = 0; $i < 20; $i++) {
         \App\Page::create(['title' => $faker->sentence(5), 'text' => $faker->paragraph(5)]);
     }
     $pages = \App\Page::all();
     for ($i = 0; $i < 5; $i++) {
         $page1 = $pages->random();
         $page2 = $pages->random();
         if ($page1 == $page2) {
             continue;
         }
         try {
             $page1->makeChildOf($page2);
         } catch (\Exception $e) {
         }
     }
 }
开发者ID:ntamvl,项目名称:admin-3-demo,代码行数:19,代码来源:PagesSeeder.php

示例12: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     /* $admin = new Role;
        $admin->name = 'superadmin';
        $role = Role::where('name','superadmin')->first();
        var_dump($admin->getIdByRolename('superadmin'));*/
     /* $admin = new Role;
             $admin->name = 'superadmin';
             $admin->id = 2;
             $owner = new Role;
             $owner->name = 'ordinary';
             $owner->id = 1;
     
             $manageUsers = new Permission;
             $manageUsers->name = 'manage_users';
             $manageUsers->display_name = 'Manage Users';
             $manageUsers->id = 1;
             //$manageUsers->save();
     
             $managePosts = new Permission;
             $managePosts->name = 'manage_pages';
             $managePosts->display_name = 'Manage Pages';
             $managePosts->id = 2;
             //$managePosts->save();
             $admin->perms()->sync(array($managePosts->id, $manageUsers->id));
             $owner->perms()->sync(array($managePosts->id),$owner->id);
     
     
             $user = User::where('name','=','dmodai')->first();
     
     // 可以使用 Entrust 提供的便捷方法用户授权
     // 注: 参数可以为 Role 对象, 数组, 或者 ID
             $user->attachRole( $admin );
     
     // 或者使用 Eloquent 自带的对象关系赋值
           //  $user->roles()->attach( $admin->id ); // id only*/
     //return view('AdminHome')->withPages(Page::all());
     //return view('AdminHome')->with('pages', Page::all());
     return view('AdminHome', ['pages' => Page::all()]);
 }
开发者ID:dmodaii,项目名称:laravel5.1-angular,代码行数:45,代码来源:AdminHomeController.php

示例13: index

 public function index()
 {
     $pages = Page::all();
     return view("realestateadmin::page.index", ["pages" => $pages]);
 }
开发者ID:labkod,项目名称:real-estate,代码行数:5,代码来源:PageController.php

示例14: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     return view("AdminHome")->withPages(Page::all());
 }
开发者ID:jew977,项目名称:laravel5.1,代码行数:9,代码来源:AdminHomeController.php

示例15: showPages

 /**
  * Show all pages
  *
  * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
  */
 public function showPages()
 {
     $pages = Page::all();
     return view('manage.page.all', compact('pages'));
 }
开发者ID:CaliProject,项目名称:mikenong-dev,代码行数:10,代码来源:ManageController.php


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