1
私はビューファイルYii2は、基本的な持っている、と(改ページなし)このレッスンhttps://github.com/yiisoft/yii2/blob/master/docs/guide/start-databases.mdからページを表示したいJSON形式で情報を表示する方法は?
Controller return:
return $this->render('index', [
'countries' => $countries,
'pagination' => $pagination,
]);
:たぶん私はどこで、どのように、JSONを表示するには、メインのレイアウトを変更する必要があり
<?php
use yii\helpers\Html;
use yii\widgets\LinkPager;
?>
<h1>Countries</h1>
<ul>
<?php foreach ($countries as $country): ?>
<li>
<?= Html::encode("{$country->name} ({$country->code})") ?>:
<?= $country->population ?>
</li>
<?php endforeach; ?>
</ul>
をそれを正しく行うには? Yii2で
しかし、問題はexacly何ですか? – Yupik