Yii v2 snippet guide

Comparing #194 with #195

Revision #195 was created by rackycz rackycz on Jun 30, 2020, 2:42:24 PM.

Composer

Content

[...]
'css' => [],
],
],
],
```

 
**Yii2 + Composer**
 
---
 
Once composer is installed, you might want to use it to download Yii, but following command might not work:
 
```
 
php composer.phar create-project yiisoft/yii2-app-basic basic
 
```
 
 
Change it to:
 
```
 
composer create-project yiisoft/yii2-app-basic basic
 
```
 
.. and run it. If you are in the desired folder right now, you can use . (dot) instead of the last "word":
 
```
 
composer create-project yiisoft/yii2-app-basic .
 
```
 
 
Using DatePicker:
 
Run this command: composer require --prefer-dist yiisoft/yii2-jui
 
and then use this code in your view:
 
 
<?= $form->field($model, 'date_deadline')->widget(\yii\jui\DatePicker::classname(), [
 
    //'language' => 'en',
 
    'dateFormat' => 'yyyy-MM-dd',
 
    'options' => ['class' => 'form-control']
 
]) ?>