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


PHP Article::getArticle方法代码示例

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


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

示例1: ajaxPublish

 public function ajaxPublish(Request $request)
 {
     $id = (int) $request->get('id');
     $portal = new Portal();
     $portals = $portal->getPortals();
     $data = array("portals" => $portals);
     if (isset($id) && $id > 0) {
         $model = new Article();
         $article = $model->getArticle(["id" => $id]);
         $data['article'] = $article;
     }
     return view('ajax/admin/publish', $data)->renderSections();
 }
开发者ID:kits2code,项目名称:ignore,代码行数:13,代码来源:AdminAjaxController.php

示例2: create

 public function create($id)
 {
     //
     $model = new Article();
     $article = $model->getArticle(["id" => $id]);
     $usrlike = new UserLikeModel();
     $islike = $usrlike->islike(['Article_id' => $id, 'User_id' => \Session::get('id')]);
     $user_model = new User();
     if ($article) {
         $user = $user_model->getUser(['id' => $article->Users_id]);
     }
     return view("article.index", ["article" => $article, 'islike' => $islike, 'author' => $user]);
 }
开发者ID:kits2code,项目名称:ignore,代码行数:13,代码来源:ArticleController.php

示例3: create

 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function create()
 {
     //
     $usrlike = new UserLikeModel();
     $user_model = new User();
     if ($Uid = \Session::get('id')) {
         $user = $user_model->getUser(['id' => $Uid]);
         $attributes = ['User_id' => $Uid];
         $alllikes = $usrlike->getAll($attributes, ['Article_id']);
         $article_model = new Article();
         $articles = null;
         foreach ($alllikes as $Aid) {
             $articles[] = $article_model->getArticle(['id' => $Aid->Article_id]);
         }
     }
     return view("user.create", ['articles' => $articles, 'alllikes' => $alllikes, 'user' => $user]);
 }
开发者ID:kits2code,项目名称:ignore,代码行数:22,代码来源:UserController.php

示例4: index

 /**
  * 
  */
 public function index()
 {
     //\Session::getId();
     // echo('<pre>');
     // print_r(\Session::getId());
     // die();
     //MENU
     $mainMenu = Category::getParentMenu();
     $allMenu = Category::getAllMenu($mainMenu);
     //HOT PRODUCTS.
     $hotProduct = Product::hotProduct();
     //DISCOUNT PRODUCTS.
     $discountProduct = Product::discountProduct();
     //NEW PRODUCTS.
     $newProduct = Product::newProduct();
     //ARTICLES
     $article = Article::getArticle();
     // dd($hotProduct);
     return view('index', compact('allMenu', 'newProduct', 'discountProduct', 'hotProduct', 'article'));
     // return view("fornindex.detail",compact('allMenu'));
 }
开发者ID:hoangvu2015,项目名称:laravel_totnghiep,代码行数:24,代码来源:PagesController.php

示例5: show

 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     //
     $user_like_model = new UserLikeModel();
     $article_model = new Article();
     $user_model = new User();
     $ids = $user_like_model->getAll(['User_id' => $id], ['Article_id']);
     $articles = [];
     $index = 0;
     foreach ($ids->items() as $item) {
         $tmp = $article_model->getArticle(['id' => $item->Article_id]);
         $articles[$index]['title'] = strip_tags($tmp->title);
         $articles[$index]['content'] = strip_tags($tmp->content);
         $articles[$index]['author'] = $user_model->getUser(['id' => $tmp->Users_id], ['name'])->name;
         $articles[$index]['created_at'] = $tmp->created_at;
         $articles[$index]['updated_at'] = $tmp->updated_at;
         ++$index;
     }
     $response = [];
     $response['s'] = '1';
     $response['msg'] = 'okay!';
     $response['articles'] = $articles;
     die(json_encode($response));
 }
开发者ID:kits2code,项目名称:ignore,代码行数:30,代码来源:PortalController.php


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