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


PHP Categories::i方法代码示例

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


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

示例1: index

 public function index()
 {
     $data = ['title' => 'Categories', 'categories' => Categories::i()->allWithPostsCount()];
     $this->title->prepend($data['title']);
     View::share('menu_item_active', 'categories');
     return view('root.categories.index', $data);
 }
开发者ID:vitos8686,项目名称:0ez,代码行数:7,代码来源:CategoriesController.php

示例2: compose

 public function compose(View $view)
 {
     $categories = \App\Models\Categories::i()->withPostsCount();
     $posts_count = \App\Models\Posts::active()->count();
     $view->with('categories', $categories);
     $view->with('posts_count', $posts_count);
 }
开发者ID:vitos8686,项目名称:0ez,代码行数:7,代码来源:CategoriesMenuComposer.php

示例3: index

 public function index()
 {
     Title::prepend('Categories');
     $data = ['title' => Title::renderr(' : ', true), 'categories' => Categories::i()->allWithPostsCount()];
     view()->share('menu_item_active', 'categories');
     return view('root.categories.index', $data);
 }
开发者ID:garf,项目名称:0ez,代码行数:7,代码来源:CategoriesController.php

示例4: index

 public function index($slug = '')
 {
     if ($slug != '') {
         $category = Categories::i()->getBySlug($slug);
         if (empty($category)) {
             abort(404);
         }
         $category_id = $category->id;
         view()->share('active_category', $category_id);
         view()->share('seo_title', 'Категория: ' . $category->seo_title);
         view()->share('seo_description', $category->seo_description);
         view()->share('seo_keywords', $category->seo_keywords);
         Title::prepend('Категория');
         Title::prepend($category->seo_title);
     } else {
         Title::append(Conf::get('seo.default.seo_title'));
         $category = null;
         $category_id = null;
     }
     $q = request('q', null);
     if (!empty($q)) {
     }
     $posts = Posts::i()->getPostsByCategoryId($category_id, $q);
     $data = ['posts' => $posts, 'category' => $category, 'q' => $q, 'title' => Title::renderr(' : ', true)];
     return view('site.posts.index', $data);
 }
开发者ID:garf,项目名称:0ez,代码行数:26,代码来源:PostsController.php

示例5: index

 public function index($slug = '')
 {
     if ($slug != '') {
         $category = Categories::i()->getBySlug($slug);
         if (empty($category)) {
             abort(404);
         }
         $category_id = $category->id;
         View::share('active_category', $category_id);
         View::share('seo_title', 'Категория: ' . $category->seo_title);
         View::share('seo_description', $category->seo_description);
         View::share('seo_keywords', $category->seo_keywords);
         $this->title->prepend('Категория: ' . $category->seo_title);
     } else {
         $category = null;
         $category_id = null;
     }
     $data = ['posts' => Posts::i()->getPostsByCategoryId($category_id), 'category' => $category];
     return view('site.posts.index', $data);
 }
开发者ID:vitos8686,项目名称:0ez,代码行数:20,代码来源:PostsController.php


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