dev-master
9999999-dev https://github.com/icalab/yii2-ica-mediafileExtension for attaching media files to models.
The Requires
extension yii2 widget media detail
Wallogit.com
2017 © Pedro Peláez
Extension for attaching media files to models.
Extension for attaching media files to models, (*1)
composer require icalab/yii2-ica-mediafile
php yii migrate --migrationPath=@icalab/mediafile/migrations
The relevant code files contain documentation at the top of the files. There is also the Voorbeeld model and the VoorbeeldController that you can use to see an example of how this module works., (*2)
In short:, (*3)
$model->newFile = UploadedFile::getInstance($model, 'newFile');
if($model->validate() && (! $model->newFiles || $this->saveMediaFiles($model)))
{
$model->save();
$this->redirect(['update', 'id' => $id]);
}
echo AttachMediafileWidget::widget(['model' => $model, 'form' => $form]);
Extension for attaching media files to models.
extension yii2 widget media detail