<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>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                ## 視圖 視圖是 MVC 模式中的一部分。 它是展示數據到終端用戶的代碼。 在網頁應用中,根據視圖模板來創建視圖,視圖模板為PHP腳本文件, 主要包含HTML代碼和展示類PHP代碼,簡單起見,我們稱視圖模板或視圖模板文件為視圖。 ## 渲染視圖 模板文件的寫法支持下面幾種: | 用法 | 描述 | | --- | --- | | 不帶任何參數 | 自動定位當前操作的模板文件 | | \[模塊/\]\[控制器/\]\[操作\] | 常用寫法,支持跨模塊 | 下面是一個最典型的用法,不帶任何參數: ~~~ // +---------------------------------------------------------------------- // | onegow [ WE CAN DO IT MORE SIMPLE] // +---------------------------------------------------------------------- // | Copyright (c) 2016-2018 http://onegow.com All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- // | Author: mrye 55585190@qq.com // +---------------------------------------------------------------------- namespace inc\mobile; class Action extends Base { /** * 模板使用方法類似于tp * 模板操作 */ public function tpl() { return $this->view(); } } ~~~ 如果沒有按照模板定義規則來定義模板文件(或者需要調用其他控制器下面的某個模板),可以使用: ~~~ // 指定模板輸出 return $this->view('edit'); ~~~ 表示調用當前控制器下面的edit模板 ~~~ return $this->view('member/read'); ~~~ 表示調用Member控制器下面的read模板。 ~~~ return $this->view('web/member/edit'); ~~~ 跨模塊渲染模板,代表web模塊中的member控制器底下的edit模板 ## 視圖賦值 除了系統變量和配置參數輸出無需賦值外,其他變量如果需要在模板中輸出必須首先進行模板賦值操作,否則在模板中無法使用變量,例如: ### `assign`方法 ~~~ // +---------------------------------------------------------------------- // | onegow [ WE CAN DO IT MORE SIMPLE] // +---------------------------------------------------------------------- // | Copyright (c) 2016-2018 http://onegow.com All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- // | Author: mrye 55585190@qq.com // +---------------------------------------------------------------------- namespace inc\mobile; class Action extends Base { /** * 模板使用方法類似于tp * 模板操作 */ public function tpl() { $this->assign([ 'name' => 'mrye', 'email' => '55585190@qq.com' ]); return $this->view(); } } ~~~ ### 方法傳入參數 方法`view`可傳入模板變量,例如 ~~~ // +---------------------------------------------------------------------- // | onegow [ WE CAN DO IT MORE SIMPLE] // +---------------------------------------------------------------------- // | Copyright (c) 2016-2018 http://onegow.com All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- // | Author: mrye 55585190@qq.com // +---------------------------------------------------------------------- namespace inc\mobile; class Action extends Base { public function tpl() { return $this->view('index', [ 'name' => 'mrye', 'email' => '55585190@qq.com' ]); } } ~~~
                  <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>

                              哎呀哎呀视频在线观看