Download the PHP package axelpal/yii2-attachments without Composer
On this page you can find all versions of the php package axelpal/yii2-attachments. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package yii2-attachments
Yii2 attachments
Extension for file uploading and attaching to the models
This fork has been made by me and by company Elitmaster.
Demo
You can see the demo on the krajee website
Installation
-
The preferred way to install this extension is through composer.
Either run
or add
to the require section of your
composer.json
file. -
Add module to your main config:
Also, add these lines to your console config:
-
Apply migrations
-
Attach behavior to your model (be sure that your model has "id" property)
-
Make sure that you have added
'enctype' => 'multipart/form-data'
to the ActiveForm options - Make sure that you specified
maxFiles
in module rules andmaxFileCount
onAttachmentsInput
to the number that you want
Usage
-
In the
form.php
of your model add file input -
Use widget to show all attachments of the model in the
view.php
-
(Deprecated) Add onclick action to your submit button that uploads all files before submitting form
- You can get all attached files by calling , for example:
All versions of yii2-attachments with dependencies
yiisoft/yii2 Version *
kartik-v/yii2-widget-fileinput Version v1.0.3
himiklab/yii2-colorbox-widget Version *
yiisoft/yii2-jui Version ^2.0