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

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                >[info]修改 models/Article.php 為: ~~~ <?php /** * Article model */ class Article { public static function first() { $connect = mysqli_connect("localhost", 'root', 'root', 'uwebcms6') or die('連接失敗'.mysqli_connect_error()); mysqli_query($connect,"set names utf8"); $query = mysqli_query($connect, "select * from uwebcms_document limit 1,2"); if(mysqli_num_rows($query) > 0) { while($row = mysqli_fetch_assoc($query)){ $result[] = $row; } return $result; } mysqli_close($connect); } } ~~~ >[info]將包含查詢結果的數組返回。修改 HomeController: ~~~ <?php /** * HomeController */ class HomeController extends BaseController { public function home(){ $article = Article::first(); require dirname(__FILE__).'/../views/home.php'; } } ~~~ >[info]在views文件夾下新建home.php文件 ~~~ <!DOCTYPE html> <html> <head> <title>view視圖調用測試</title> </head> <style type="text/css"> table, tr, th, td { border: 1px solid #000; border-collapse:collapse; } </style> <body> <table> <tr> <th>標題</th> <th>作者</th> <th>標簽</th> <th>描述</th> </tr> <?php foreach($article as $key=>$value) { ?> <tr> <td><? echo $value['title']; ?></td> <td><? echo $value['author']; ?></td> <td><? echo $value['tags']; ?></td> <td><? echo $value['description']; ?></td> </tr> <?php } ?> </table> </body> </html> ~~~ 刷新頁面后同樣出現了數據: ![](https://box.kancloud.cn/be7dbeec46a76335d739c14c25ee2bc2_720x173.png) 此時視圖調用成功實現!
                  <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>

                              哎呀哎呀视频在线观看