public function index()
 {
     $page = 1;
     if (isset($_GET['page'])) {
         $page = $_GET['page'];
     }
     $page = Article::paginate("articles.published AND articles.publish_at <= NOW()", "articles.publish_at DESC", $page, 10);
     $this->assign("page", $page);
     $this->title = "Articles";
     $this->render("article/index.tpl");
 }
 public function index()
 {
     $page = 1;
     if (isset($_GET['page'])) {
         $page = $_GET['page'];
     }
     $page = Article::paginate("", "articles.id DESC", $page, 20);
     $this->assign("page", $page);
     $this->title = "Articles";
     $this->render("article/index.tpl");
 }