コード例 #1
0
ファイル: news.php プロジェクト: radiosilence/trouble
 public function display_article()
 {
     $t = $this->_template;
     $t->article = \Plugins\Articles\Article::mapper()->get_article($this->_args['article_id'], 'Agent');
     $t->content = $t->render('news_article.php');
     $t->title = $article->title;
     echo $t->render('main.php');
 }
コード例 #2
0
ファイル: admin.php プロジェクト: radiosilence/littlesister
 public function index() {
     $t = $this->_template;
     $at = \Plugins\Articles\Plugin::get_template('admin/list.php');
     $at->admin_url = '/admin';
     $at->articles = \Plugins\Articles\Article::mapper()
         ->attach_storage(\Core\Storage::container()
             ->get_storage('Article')
         )
         ->get_latest_articles(True);
     $t->admin_content = $at->render();
     $t->content = $t->render('admin_home.php');
     echo $t->render('main.php');
 }
コード例 #3
0
ファイル: page.php プロジェクト: radiosilence/littlesister
 public function display_article() {
     $this->_init();
     $t = $this->_template;
     try {
         $t->article = \Plugins\Articles\Article::mapper()
             ->get_article($this->_args['article_id']);
         $t->article_id = $this->_args['article_id'];
         $t->content = $t->render('news_article.php');
         $t->title = $t->article->title;
         $t->canonical = $t->article->id . '/' . $t->article->seo_title . ".html";
         echo $t->render('main.php');            
     } catch (\Plugins\Articles\ArticleNotFoundError $e) {
         throw new \Core\HTTPError(404, "Article #{$this->_args[article_id]}");
     }
 }