Upload files in Yii2 with MongoDb and GridFs

Comparing #10 with #11

Revision #11 was created by skworden skworden on Oct 30, 2014, 11:18:20 PM.

updated namespace

Content

[...]
In _form.php (format as you like, in this case there's no html because I put this form in a modal with custom html and tags that can be confusing for the sake of the tutorial)


```php
<?php
use yii\helpers\Html;
 
use yii\widgets\ActiveForm;
 
 
$form = ActiveForm::begin([
'options'=>['enctype'=>'multipart/form-data']]);?>

<?= $form->field($model, 'description')->textInput(['class'=>'form-control inline-input', 'placeholder'=>Yii::t('app', 'Description')])->label('')?>

<?= $form->field($model, 'file')->fileInput()->label('')?>
[...]