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


PHP Article::topN方法代码示例

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


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

示例1: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $teachers = Teacher::topN(6);
     $articles = Article::topN(6);
     $categories_in_pane = ArticleCategory::all();
     return response()->view('site.classes', array('teachers' => $teachers, 'other_articles' => $articles, 'categories_in_pane' => $categories_in_pane));
 }
开发者ID:ryandong82,项目名称:zhsite,代码行数:12,代码来源:ClassController.php

示例2: show

 /**
  * Display the specified resource.
  *
  * @param  int $id
  * @return Response
  */
 public function show($id)
 {
     //
     $teacher = Teacher::find($id);
     $teachers = Teacher::topN(6);
     $articles = Article::topN(6);
     $categories_in_pane = ArticleCategory::all();
     return response()->view('site.teacher', array('teacher' => $teacher, 'teachers' => $teachers, 'other_articles' => $articles, 'categories_in_pane' => $categories_in_pane));
 }
开发者ID:ryandong82,项目名称:zhsite,代码行数:15,代码来源:TeacherPageController.php

示例3: show

 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     //
     $teachers = Teacher::topN(6);
     $article = Article::find($id);
     $other_articles = Article::topN(6);
     $categories_in_pane = ArticleCategory::all();
     $article->content = MyUtil::replace_reference_tag($article->content) ?: $article->content;
     $resp = view('site.article', array('article' => $article, 'teachers' => $teachers, 'other_articles' => $other_articles, 'categories_in_pane' => $categories_in_pane));
     return $resp;
 }
开发者ID:ryandong82,项目名称:zhsite,代码行数:17,代码来源:ArticleSiteController.php

示例4: show

 /**
  * Display the specified resource.
  *
  * @param  int $id
  * @return Response
  */
 public function show($id, $pageNo)
 {
     //$category = ArticleCategory::with("articles")->find($id);
     $category = ArticleCategory::find($id);
     $teachers = Teacher::topN(6);
     //query()->orderBy('ord_no')->where('in_intro', '1')->take(6)->get();
     $articles = $category->articles()->getResults();
     $other_articles = Article::topN(6);
     $categories_in_pane = ArticleCategory::all();
     //dd($categories_in_pane);
     //$articleCnt = $category->articles()->getResults();
     $resp = view('site.category', array('category' => $category, 'teachers' => $teachers, 'articles' => $articles, 'other_articles' => $other_articles, 'categories_in_pane' => $categories_in_pane));
     //$resp = view('site.test', array('category'=>$category, 'teachers'=>$teachers, 'articles'=>$articles));
     return $resp;
 }
开发者ID:ryandong82,项目名称:zhsite,代码行数:21,代码来源:ArticleCategoryController.php

示例5: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     //
     //return 'hello';
     //$article = Article::all();
     //return $article;
     //return ArticleCategory::find(1)->getForeignKey();
     $article_categories = ArticleCategory::query()->orderBy("ord_no")->get();
     //return $articles;
     $horzPics = MainHorizontalPics::all();
     $articles = Article::topN(15);
     //        foreach ($articles as $article) {
     //            $article["file"] = MyUtil::get_res_file($article->content);
     //        }
     ///return $article;
     return response()->view('site.index', array('categories' => $article_categories, 'articles' => $articles, 'horzPics' => $horzPics));
 }
开发者ID:ryandong82,项目名称:zhsite,代码行数:22,代码来源:IndexController.php


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