-
Notifications
You must be signed in to change notification settings - Fork 0
/
ArticleController.php
52 lines (43 loc) · 1.02 KB
/
ArticleController.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php namespace App\Http\Controllers;
use App\Components\EndaPage;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use App\Model\Tag;
use Illuminate\Http\Request;
use App\Model\ArticleStatus;
use App\Model\Article;
class ArticleController extends Controller
{
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
//
$article = Article::getNewsArticle(12);
viewInit();
$page = new EndaPage($article['page']);
return homeView('index', array(
'articleList' => $article,
'page' => $page
));
}
/**
* Display the specified resource.
*
* @param int $id
* @return Response
*/
public function show($id)
{
$article = Article::getArticleModelByArticleId($id);
ArticleStatus::updateViewNumber($id);
$data = array(
'article' => $article,
);
viewInit();
return homeView('article', $data);
}
}