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


PHP Page::active方法代码示例

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


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

示例1: pageCreateView

 public function pageCreateView($context, $alias, $value = [])
 {
     $menuLevel = [];
     $page = $this->pageModel($context, $alias);
     SEO::setTitle($page->title);
     SEO::setDescription($page->description);
     if ($page->image) {
         SEO::addImages(asset($page->image));
     }
     $value['page'] = $page;
     if ($page->comments and $this->view_comments) {
         $page->load('comments', 'comments.user');
         $value['comments'] = $page->comments;
     }
     $value['view_comments'] = $this->view_comments;
     if ($page->menu) {
         $page->menu->setActiveThis();
         $menuLevel = $page->menu->getMapLevel(true);
         if ($this->list) {
             $childs = $page->menu->getChildsId(true);
             $list = Page::active()->where('context', $this->list)->whereIn('menu_id', $childs)->sort()->with('user', 'fields', 'tag')->paginate(15);
             $value['list'] = $list;
         }
     }
     foreach ($menuLevel as $key => $val) {
         $value['menu_level_' . $key] = $val;
     }
     if ($this->template) {
         $view = $this->view($this->template, $value);
     } else {
         $view = $this->view('tpl.' . $page->template, $value);
     }
     return $view;
 }
开发者ID:jetcms,项目名称:website,代码行数:34,代码来源:PageController.php

示例2: addItem

 protected function addItem($feed)
 {
     $pages = Page::active()->get();
     if ($pages) {
         foreach ($pages as $key => $page) {
             if ($key == 0) {
                 $feed->pubdate = $page->created_at->toDateTimeString();
             }
             // set item's title, author, url, pubdate, description and content
             //$author =  ;
             $feed->add($page->title, $page->user ? $page->user->name : $this->default_author, URL::to($page->url), $page->publish, $page->description, $page->content);
         }
     }
     return $feed;
 }
开发者ID:jetcms,项目名称:website,代码行数:15,代码来源:FeedController.php

示例3: makeArray

 private static function makeArray()
 {
     $settings = Settings::get()->toArray();
     // insert default settings if first run application
     if (!$settings) {
         self::createDefault();
         User::createDefault();
         $arr = self::$default;
     } else {
         foreach ($settings as $item) {
             $name = $item['name'];
             $array_value = json_decode($item['value']);
             $value = $array_value ? $array_value : $item['value'];
             $arr[$name] = $value;
         }
     }
     // Front navbar menu
     $arr['page_menu'] = Page::active()->where('to_menu', 1)->orderBy('sorter')->get()->lists('name', 'slug');
     // admin credentials
     $user = User::find(1);
     $arr['name'] = $user->name;
     $arr['admin_email'] = $user->email;
     return $arr;
 }
开发者ID:vasiliy-mk,项目名称:apartment-rent,代码行数:24,代码来源:Settings.php

示例4: getData

 protected function getData()
 {
     return Page::active()->with('user')->get();
 }
开发者ID:jetcms,项目名称:website,代码行数:4,代码来源:SitemapController.php


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