Created
October 17, 2012 17:53
-
-
Save tony1223/3907025 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function view($articleID = null){ | |
if($articleID == null){ | |
show_404("Article not found !"); | |
return true; | |
} | |
$this->load->model("ArticleModel"); | |
//完成取資料動作 | |
$article = $this->ArticleModel->get($articleID); | |
if($article == null){ | |
show_404("Article not found !"); | |
return true; | |
} | |
//更新文章計數 | |
$this->ArticleModel->updateViews($articleID,$article->Views +1 ); | |
$this->load->view('article_view',Array( | |
//設定網頁標題 | |
"pageTitle" => "發文系統 - 文章 [".$article->Title."] ", | |
"article" => $article | |
)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment