<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國際加速解決方案。 廣告
                視圖模板用的smarty3模板 并自定義模板定界符為:<{和}> (為了防止和jquery模板沖突) 這里僅對簡單語法作介紹,更多語法請參考[smarty3中文手冊](https://www.smarty.net/docs/zh_CN/) 視圖目錄為:Applications/webApp/view/控制器名(首字母大寫其余字母小寫)。 所有視圖文件應統一放在視圖目錄下并以.html結尾。 控制器基類渲染函數為display($html,$data),其中$html為視圖文件地址(相對于視圖目錄)。$data為傳遞變量數組。 示例:調用Applications/webApp/view/User/hello.html作為視圖文件 ``` namespace controller; use workerWeb\web\Controller; class User extends Controller{ public function index (){ return $this->display('hello'); } } ``` 如果不傳$html會以當前action的小寫格式作為視圖文件地址 如: ``` namespace controller; use workerWeb\web\Controller; class User extends Controller{ public function index (){ return $this->display(); } } ``` 會調用Applications/webApp/view/User/index.html作為視圖文件。 $data必須傳遞數組格式,其作用為將php變量傳遞到視圖文件中 如: ``` namespace controller; use workerWeb\web\Controller; class User extends Controller{ public function index (){ $name = 'word'; return $this->display('',['name'=>$name]); } } ``` 視圖文件渲染變量方式為`<{$變量名}>` 如: ``` <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> hello <{$name}>! </body> </html> ``` ![](https://box.kancloud.cn/bd36412126408921c3c67ba21d1c8032_398x164.png) 還有一種變量傳遞方式為調用控制器基類方法assign($name,$value); $name為傳遞參數名,$value為值。 調用示例: ``` //控制器文件 namespace controller; use workerWeb\web\Controller; class User extends Controller{ public function index (){ $name = 'word'; $this->assign('name',$name); return $this->display(); } } ``` 更多語法請參考[smarty3中文手冊](https://www.smarty.net/docs/zh_CN/)
                  <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>

                              哎呀哎呀视频在线观看