コード例 #1
0
ファイル: Page.php プロジェクト: grlf/eyedock
 public function render(Am_View $view, $user = null)
 {
     $html = $this->html;
     if (strpos($html, '%user.') !== false) {
         $t = new Am_SimpleTemplate();
         if ($user) {
             $t->assign('user', $user);
         }
         $t->assignStdVars();
         $html = $t->render($html);
     }
     if ($this->use_layout) {
         $view->content = '<div class="am-content-page">' . $html . '</div>';
         $view->title = $this->title;
         $view->meta_title = $this->meta_title ? $this->meta_title : $this->title;
         if ($this->meta_keywords) {
             $view->headMeta()->setName('keywords', $this->meta_keywords);
         }
         if ($this->meta_description) {
             $view->headMeta()->setName('description', $this->meta_description);
         }
         return $view->render($this->tpl ? $this->tpl : 'layout.phtml');
     } else {
         return $html;
     }
 }