<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                [TOC] ### 基本視圖的使用 控制器`Index`: ~~~php <?php namespace module\index\controller; use lying\base\Controller; class IndexCtrl extends Controller { public function index() { return $this->render(); } } ~~~ 在控制器對應視圖目錄`module/index/view/index/`下定義視圖文件`index.html`: ~~~ <h1>歡迎使用Lying</h1> ~~~ 當你訪問這`index`方法的時候,你就能看見大大的'歡迎使用Lying'。 如果帶上參數: ~~~php <?php namespace module\index\controller; use lying\base\Controller; class IndexCtrl extends Controller { public function index() { return $this->render('welcome'); } } ~~~ 那么對應的視圖文件就是`module/index/view/index/welcome.html`咯 ### 視圖賦值 控制器`Index`: ~~~php <?php namespace module\index\controller; use lying\base\Controller; class IndexCtrl extends Controller { public function index() { $this->assign('name', 'Lying'); $this->assign(['id'=>10, 'sex'=>'男']); return $this->render(); } } ~~~ 在控制器對應視圖目錄`module/index/view/index/`下定義視圖文件`index.html`: ~~~php <h1>歡迎使用{$name} {$id} {$sex}</h1> ~~~ 當你訪問這`index`方法的時候,你還是能看見大大的`'歡迎使用Lying 10 男'`。 ### 視圖文件路徑 > 如果你的控制器名不想和視圖文件夾名稱對應,或者想使用其他視圖目錄下的視圖文件或者布局文件,你可以這樣做: ~~~php return $this->render('welcome'); //使用當前module下'view/控制器ID/welcome.html' return $this->render('my/welcome'); //使用當前module下'view/控制器ID/my/welcome.html' return $this->render('/welcome'); //使用當前module下'view/welcome.html' return $this->render('/welcome/t'); //使用當前module下'view/welcome/t.html' ~~~ ### 使用自定義視圖路徑 視圖的路徑默認是 `module/當前模塊/view`,你可以自定義模板路徑: ~~~php <?php namespace module\index\controller; use lying\base\Controller; class IndexCtrl extends Controller { public function init() { parent::init(); $this->viewPath = DIR_ROOT . DS . 'tpl'; //自定義視圖路徑 } public function index() { //這時候模板路徑就是 DIR_ROOT . DS . 'tpl/index/index.html' return $this->render(); } } ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看