<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國際加速解決方案。 廣告
                在TP3.X中,我們通常使用$this->display()將一個模板渲染到網頁上面去。比如在Index模塊下面,我們新建一個view目錄,然后再創建一個index目錄,在其中創建一個html文件為index.html。如果要將這個html文件渲染到網頁上面去的話,在TP5.X中,我們可以使用下面的語句: `return view('index');` 如果我們要在一個網頁中輸出變量的話,我們可以在view助手函數的第二個參數中將值傳入進去。 HTML網頁: ~~~ <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> </head> <body> Hello {$name}! </body> </html> ~~~ 其對應的PHP代碼: ~~~ <?php namespace app\index\controller; class Index { public function index(){ return view('index',['name'=>'c7']); } } ~~~ 那么如果我們要對上面的模板變量進行測試的話,我們可以使用下面三種方法: 1. assertViewHas 2. assertViewHasAll 3. assertViewMissing 第一個函數接受一個key值和一個value。 第二個函數則接受一個由key-value組成的數組。 第三個函數接受一個key,斷言渲染的時候不存在某個key值的模板變量。 針對上面的例子,我們可以這么斷言: ~~~ <?php namespace tests; //針對Index控制器 class IndexTest extends TestCase { public function testOutput(){ $this->visit('/index/index/index')->assertViewHas('name','c7'); } } ~~~
                  <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>

                              哎呀哎呀视频在线观看