public function getIndex() { Debugbar::startMeasure('load data', '载入文章数据'); $articleList = new ArticleList(); $articleList->load(); Debugbar::stopMeasure('load data'); Debugbar::startMeasure('render index', '渲染'); $view = View::make('site/article/index', array('articleList' => $articleList->data)); Debugbar::stopMeasure('render index'); return $view; }
public function getArticles() { if (Input::has('firstArticleID')) { $latest = Cacher::get(LATEST_ARTICLE_ID_KEY); if (Input::get('firstArticleID') >= $latest) { return $this->jsonResponse(array()); } } $articleList = new ArticleList(); $articleList->load(); return $this->jsonResponse($articleList->data); }
private function getArticles() { $articleList = new ArticleList(); $articleList->load(); return $articleList->data; }