display() public method

渲染内容输出
public display ( string $content, array $vars = [], array $replace = [], array $config = [] ) : mixed
$content string 内容
$vars array 模板输出变量
$replace array 替换内容
$config array 模板参数
return mixed
 /**
  * 随便看看
  */
 public function look()
 {
     $prefix = C('DB_PREFIX');
     $sql = "select * from {$prefix}forum_post where status=1 order by rand() LIMIT 0 , " . modC('FORM_POST_SHOW_NUM_PAGE', '10', 'Forum');
     $post = M('')->query($sql);
     $post = $this->forumPostModel->assignForumInfo($post);
     if (IS_POST) {
         $view = new View();
         $view->assign('posts', $post);
         $view->display(T('Forum@Index/_look'));
         exit;
     }
     $this->assign('tab', 'look');
     $this->assign('posts', $post);
     $this->display();
 }
Exemplo n.º 2
0
 public function index()
 {
     $view = new View();
     $view->display();
 }
Exemplo n.º 3
0
 /**
  * 随便看看
  */
 public function look()
 {
     $prefix = C('DB_PREFIX');
     $post = M('')->query("select * from {$prefix}forum_post order by rand()");
     $post = $this->forumPostModel->assignForumInfo($post);
     if (IS_POST) {
         $view = new View();
         $view->assign('posts', $post);
         $view->display(T('Forum@Index/_look'));
         exit;
     }
     $this->assign('tab', 'look');
     $this->assign('posts', $post);
     $this->display();
     //dump(D()->getLastSql());
     // dump($post);exit;
 }