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

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                ### Models, Views, Controllers >[info] http://www.yiichina.com/doc/guide/2.0/structure-overview ![](https://box.kancloud.cn/2015-10-10_561892e50429e.png) ### 向View傳遞Model >[info] 項目代碼下載 https://git.oschina.net/radarxu/yii-demo 1、簡單模型 frontend\controllers\SiteController.php ~~~ php public function actionAbout() { $location = '中國,上海'; return $this->render('about', ['location' => $location]); } ~~~ frontend\views\site\about.php ~~~ html /* @var $location string */ <p>地址: <?= $location ?></p> ~~~ 2、數組模型 frontend\controllers\SiteController.php ~~~ php public function actionAbout() { $location = ['city' => '上海', 'country' => '中國']; return $this->render('about', ['location' => $location]); } ~~~ frontend\views\site\about.php ~~~ html /* @var $location array */ <p>城市: <?= $location['city'] ?></p> <p>國家: <?= $location['country'] ?></p> ~~~ 3、復雜模型 frontend\controllers\SiteController.php ~~~ php public function actionAbout() { $model = new AboutModel(); $model->name = '徐飛'; $model->city = '上海'; $model->country = '中國'; return $this->render('about', ['model' => $model]); } ~~~ frontend\views\site\about.php ~~~ html /* @var $model frontend\models\AboutModel */ <p>姓名: <?= $model->name ?></p> <p>城市: <?= $model->city ?></p> <p>國家: <?= $model->country ?></p> ~~~ 4、多個模型 frontend\controllers\SiteController.php ~~~ php public function actionAbout() { $name = '徐飛'; $city = '上海'; $country = '中國'; return $this->render('about', ['name' => $name, 'city' => $city, 'country' => $country]); } ~~~ frontend\views\site\about.php ~~~ html /* @var $name string */ /* @var $city string */ /* @var $country string */ <p>姓名: <?= $name ?></p> <p>城市: <?= $city ?></p> <p>國家: <?= $country ?></p> ~~~
                  <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>

                              哎呀哎呀视频在线观看