Hi
now i am start learning yii 2.0…
i have create an application…
now i want dropdown for country table…
please i want the syntax for that…
thanks
Hi
now i am start learning yii 2.0…
i have create an application…
now i want dropdown for country table…
please i want the syntax for that…
thanks
Some examples:
Hello,
i got the solution…its quite easy…
two steps :
use yii\helpers\ArrayHelper;
use app\models\Country;
<?= Html::activeDropDownList($model, 'country_id',
ArrayHelper::map(Country::find()->all(), 'id', 'name'), ['prompt'=>'-Choose a Country-']) ?>
Here,ArrayHelper in Yii2 replaces the CHtml list data in Yii 1.1.
so, add this in your _form.php
Hi yiim,
Thanks a lot for your reply…
Thank you.