當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Content::all方法代碼示例

本文整理匯總了PHP中Content::all方法的典型用法代碼示例。如果您正苦於以下問題:PHP Content::all方法的具體用法?PHP Content::all怎麽用?PHP Content::all使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Content的用法示例。


在下文中一共展示了Content::all方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: fire

 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     // Generate groups sitemap
     $sitemap = App::make("sitemap");
     $x = 1;
     foreach (Group::all() as $group) {
         $sitemap->add(URL::to(route('group_contents', $group->getKey())), null, '1.0', 'daily');
         $sitemap->add(URL::to(route('group_contents_new', $group->getKey())), null, '1.0', 'daily');
         $sitemap->add(URL::to(route('group_entries', $group->getKey())), null, '1.0', 'daily');
         if (!($x % 100)) {
             $this->info($x . ' groups processed');
         }
         $x++;
     }
     $this->info('All groups processed');
     $sitemap->store('xml', 'sitemap-groups');
     unset($sitemap);
     // Generate entries sitemap
     $sitemap = App::make("sitemap");
     $x = 1;
     foreach (Content::all() as $content) {
         $route = route('content_comments_slug', [$content->getKey(), Str::slug($content->title)]);
         $sitemap->add(URL::to($route), $content->modified_at, '1.0', 'daily');
         if (!($x % 100)) {
             $this->info($x . ' contents processed');
         }
         $x++;
     }
     $this->info('All contents processed');
     $sitemap->store('xml', 'sitemap-contents');
     unset($sitemap);
     // Generate contents sitemap
     $sitemap = App::make("sitemap");
     $x = 1;
     foreach (Entry::all() as $entry) {
         $route = route('single_entry', $entry->getKey());
         $sitemap->add(URL::to($route), $entry->modified_at, '1.0', 'daily');
         if (!($x % 100)) {
             $this->info($x . ' entries processed');
         }
         $x++;
     }
     $this->info('All entries processed');
     $sitemap->store('xml', 'sitemap-entries');
     unset($sitemap);
     // Generate global sitemap
     $sitemap = App::make("sitemap");
     $sitemap->addSitemap(URL::to('sitemap-groups.xml'));
     $sitemap->addSitemap(URL::to('sitemap-contents.xml'));
     $sitemap->addSitemap(URL::to('sitemap-entries.xml'));
     $sitemap->store('sitemapindex', 'sitemap');
 }
開發者ID:vegax87,項目名稱:Strimoid,代碼行數:57,代碼來源:GenerateSitemap.php

示例2: index

 function index($params)
 {
     $number_of_posts = get_option('number_of_posts', $params['id']);
     if ($number_of_posts == false) {
         $number_of_posts = 5;
     }
     $number_of_posts = (int) $number_of_posts;
     //d($number_of_posts);
     //$posts = \Content::where('id', '!=',0)->take(intval($number_of_posts))->get()->toArray();
     //$posts = \Content::items()->take($number_of_posts)->get()->toArray();
     // d(\DB::getQueryLog());
     $posts = \Content::all()->take($number_of_posts);
     //  $posts = \Content::take($number_of_posts)->get();
     //d($posts);
     //$view = \View::make('mvc_example_blade::index')->withPosts($posts)->render();
     // dd($posts);
     // $view = \View::make('mvc_example_blade::index')->with('posts', $posts)->render();
     $view = \View::make('mvc_example_blade::index')->with('posts', $posts);
     //     print $view;
     return $view;
     //        print $view;
     //
     //        print 11111111;
 }
開發者ID:peter-mw,項目名稱:example-mvc,代碼行數:24,代碼來源:Controller.php

示例3: all

 public function all()
 {
     return Content::all();
 }
開發者ID:eragon011,項目名稱:kwanphayao,代碼行數:4,代碼來源:ContentService.php

示例4: indexContentEdit

 public function indexContentEdit()
 {
     $contents = Content::all();
     return View::make('admin.contentedit.index')->withContents($contents);
 }
開發者ID:imsgithub,項目名稱:hotlot.com,代碼行數:5,代碼來源:ContentController.php

示例5: contents

 public function contents()
 {
     return View::make('content.content-list')->withContents(Content::all());
 }
開發者ID:jmramos02,項目名稱:catering,代碼行數:4,代碼來源:AdminController.php


注:本文中的Content::all方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。