<?php namespace appindexcontroller; use thinkController; use thinkfacadeView; class Demo7 extends Controller { public function test1() { $content="<h3>nishi</h3>"; //return $this->view->display($content); return View::display($content); } public function test2() { $this->view->assign('title', '98'); $obj = new stdClass(); $obj->name="PHP"; $this->view->assign('obj',$obj); return $this->view->fetch(); } public function test3() { $data = appmodelDaohang::all(); $this->view->assign('data',$data); return $this->view->fetch(); } public function test4() { $data = appmodelDaohang::paginate(3); $this->view->assign('data',$data); return $this->view->fetch(); } }
php知识网