Yii v2 snippet guide

Comparing #195 with #196

Revision #196 was created by rackycz rackycz on Jun 30, 2020, 2:44:02 PM.

Composer

Content

[...]
```

**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:
 
```php
 
<?= $form->field($model, 'date_deadline')->widget(\yii\jui\DatePicker::classname(), [ //'language' => 'en', 'dateFormat' => 'yyyy-MM-dd', 'options' => ['class' => 'form-control'] ]) ?>
 
```