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


PHP Page::all方法代码示例

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


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

示例1: setupLayout

 /**
  * Setup the layout used by the controller.
  *
  * @return void
  */
 protected function setupLayout()
 {
     if (!is_null($this->layout)) {
         $categories = Category::all();
         $pages = Page::all();
         $this->layout = View::make($this->layout)->with('styles', $this->styles)->with('scripts', $this->scripts)->with('content_title', '')->with('categories', $categories)->with('pages', $pages)->with('inline_js', $this->inline_js)->with('sidebar', null);
     }
 }
开发者ID:ddcint,项目名称:benefund,代码行数:13,代码来源:BaseController.php

示例2: test_save_transaction

 public function test_save_transaction()
 {
     $pageLangs = ['en_US' => new PageLangDTO('name 1', 'content 1', 'seo title 1', 'seo description 1', 'handle 1'), 'pt_BR' => null];
     try {
         $this->pageService->save(true, $pageLangs);
     } catch (Exception $ignore) {
     }
     $pages = Page::all();
     $this->assertEmpty($pages);
 }
开发者ID:jknox12,项目名称:mirror,代码行数:10,代码来源:PageServiceTest.php

示例3: index

 public function index()
 {
     if (\Input::get('theme')) {
         \Cookie::queue('theme', \Input::get('theme'), 100);
         return Redirect::to('/')->withCookie(cookie('theme', \Input::get('theme'), 100));
     }
     $data = array('videos' => Video::where('active', '=', '1')->orderBy('created_at', 'DESC')->simplePaginate($this->videos_per_page), 'current_page' => 1, 'menu' => Menu::orderBy('order', 'ASC')->get(), 'pagination_url' => '/videos', 'video_categories' => VideoCategory::all(), 'post_categories' => PostCategory::all(), 'theme_settings' => ThemeHelper::getThemeSettings(), 'pages' => Page::all());
     //dd($data['videos']);
     return View::make('Theme::home', $data);
 }
开发者ID:rinodung,项目名称:hello-video-laravel,代码行数:10,代码来源:ThemeHomeController.php

示例4: index

 public function index()
 {
     $search_value = Input::get('value');
     if (empty($search_value)) {
         return Redirect::to('/');
     }
     $videos = Video::where('active', '=', 1)->where('title', 'LIKE', '%' . $search_value . '%')->orderBy('created_at', 'desc')->get();
     $posts = Post::where('active', '=', 1)->where('title', 'LIKE', '%' . $search_value . '%')->orderBy('created_at', 'desc')->get();
     $data = array('videos' => $videos, 'posts' => $posts, 'search_value' => $search_value, 'menu' => Menu::orderBy('order', 'ASC')->get(), 'video_categories' => VideoCategory::all(), 'post_categories' => PostCategory::all(), 'theme_settings' => ThemeHelper::getThemeSettings(), 'pages' => Page::all());
     return View::make('Theme::search-list', $data);
 }
开发者ID:rinodung,项目名称:hello-video-laravel,代码行数:11,代码来源:ThemeSearchController.php

示例5: category

 public function category($category)
 {
     $page = Input::get('page');
     if (!empty($page)) {
         $page = Input::get('page');
     } else {
         $page = 1;
     }
     $cat = PostCategory::where('slug', '=', $category)->first();
     $data = array('posts' => Post::where('active', '=', '1')->where('post_category_id', '=', $cat->id)->orderBy('created_at', 'DESC')->simplePaginate($this->posts_per_page), 'current_page' => $page, 'category' => $cat, 'page_title' => 'Posts - ' . $cat->name, 'page_description' => 'Page ' . $page, 'menu' => Menu::orderBy('order', 'ASC')->get(), 'pagination_url' => '/posts/category/' . $category, 'video_categories' => VideoCategory::all(), 'post_categories' => PostCategory::all(), 'theme_settings' => ThemeHelper::getThemeSettings(), 'pages' => Page::all());
     return View::make('Theme::post-list', $data);
 }
开发者ID:rinodung,项目名称:hello-video-laravel,代码行数:12,代码来源:ThemePostController.php

示例6: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index($category_slug)
 {
     $categories = Category::all();
     $cat_id = 0;
     foreach ($categories as $category) {
         if ($category->name == $category_slug || strtolower($category->name) == $category_slug) {
             $cat_id = $category->id;
             break;
         }
     }
     $data = array('media' => Media::where('active', '=', 1)->where('category_id', '=', $cat_id)->orderBy('created_at', 'desc')->paginate(Config::get('site.num_results_per_page')), 'categories' => Category::all(), 'pages' => Page::all(), 'settings' => Setting::first());
     return View::make('Theme::home', $data);
 }
开发者ID:nvq247,项目名称:Kxexnxh,代码行数:18,代码来源:CategoriesController.php

示例7: show_favorites

 public function show_favorites()
 {
     if (!Auth::guest()) {
         $page = Input::get('page');
         if (empty($page)) {
             $page = 1;
         }
         $favorites = Favorite::where('user_id', '=', Auth::user()->id)->orderBy('created_at', 'desc')->get();
         $favorite_array = array();
         foreach ($favorites as $key => $fave) {
             array_push($favorite_array, $fave->video_id);
         }
         $videos = Video::where('active', '=', '1')->whereIn('id', $favorite_array)->paginate(12);
         $data = array('videos' => $videos, 'page_title' => ucfirst(Auth::user()->username) . '\'s Favorite Videos', 'current_page' => $page, 'page_description' => 'Page ' . $page, 'menu' => Menu::orderBy('order', 'ASC')->get(), 'pagination_url' => '/favorites', 'video_categories' => VideoCategory::all(), 'post_categories' => PostCategory::all(), 'theme_settings' => ThemeHelper::getThemeSettings(), 'pages' => Page::all());
         return View::make('Theme::video-list', $data);
     } else {
         return Redirect::to('videos');
     }
 }
开发者ID:rinodung,项目名称:hello-video-laravel,代码行数:19,代码来源:ThemeFavoriteController.php

示例8: getMenu

    public static function getMenu()
    {
        $page = Page::all();
        foreach ($page as $value) {
            $route = $value['route'];
            $title = $value['title'];
            ?>

    <li><a href="<?php 
            echo $route;
            ?>
"><?php 
            echo $title;
            ?>
</a></li>


    <?php 
        }
    }
开发者ID:BDMADE,项目名称:laracms,代码行数:20,代码来源:AppHelper.php

示例9: home

 public function home()
 {
     try {
         $settings = Setting::first();
         if ($settings) {
             $search = Input::get('search');
             if (isset($search)) {
                 $media = Media::where('active', '=', 1)->where('title', 'LIKE', '%' . $search . '%')->orderBy('created_at', 'desc')->paginate(Config::get('site.num_results_per_page'));
             } else {
                 $media = Media::with('media_likes', 'comments')->where('active', '=', 1)->orderBy('created_at', 'desc')->paginate(Config::get('site.num_results_per_page'));
             }
             $categories = Category::orderBy('order', 'ASC')->get();
             $pages = Page::all();
             $data = array('media' => $media, 'search' => $search, 'categories' => $categories, 'pages' => $pages, 'settings' => Setting::first());
             return View::make('Theme::home', $data);
         } else {
             throw new Exception('settings not set, first install the script');
         }
     } catch (Exception $e) {
         return Redirect::to('install.php');
     }
 }
开发者ID:phanhung0906,项目名称:demo1,代码行数:22,代码来源:HomeController.php

示例10: get_create

 public function get_create()
 {
     $this->data['create'] = true;
     $this->data['pages'] = Page::all();
     return View::make('admin.' . $this->views . '.form', $this->data);
 }
开发者ID:robriggen,项目名称:Laravel-Bootstrap,代码行数:6,代码来源:sections.php

示例11: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $pages = Page::all();
     return View::make('backend.pages.index')->with('pages', $pages);
 }
开发者ID:tieuquangmg,项目名称:demo-php,代码行数:10,代码来源:PageController.php

示例12: all

function all($request)
{
    $page = new Page();
    $list = $page->all($page);
    echo json_encode($list);
}
开发者ID:jhmachado,项目名称:tools,代码行数:6,代码来源:page.php

示例13: action_new

 public function action_new()
 {
     $pages = Page::all();
     $tree = $this->createTree($pages);
     return View::make('admin.pages.new')->with('pages', $tree);
 }
开发者ID:ryankennedy1991,项目名称:Toure-cms,代码行数:6,代码来源:pages.php

示例14: index

 /**
  * Display a listing of pages
  *
  * @return Response
  */
 public function index()
 {
     $pages = Page::all()->except(array(1, 2));
     return View::make('pages.index', compact('pages'));
 }
开发者ID:arbuuuud,项目名称:gnt-aops,代码行数:10,代码来源:PagesController.php

示例15: isset

<?php

include '../../inc/init.inc';
isset($conditions) ? $args['conditions'] = $conditions : '';
$res->total = isset($args) ? Page::count($args) : Page::count();
$res->currentPage = isset($currentPage) ? $currentPage : 1;
$res->limit = $args['limit'] = isset($limit) ? $limit : 7;
$args['offset'] = ($res->currentPage - 1) * $args['limit'];
$args['order'] = isset($order) ? $order : 'created_at desc';
$res->pages = Page::all($args);
$res->search_opts = array(0 => array('label' => 'Quel article cherchez vous ?', 'field' => 'title', 'type' => 'text', 'class' => 'xxlarge'));
$res->useTemplate("Wiki");
开发者ID:Osin,项目名称:Intranet,代码行数:12,代码来源:wiki.php


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