Download the PHP package jakharbek/yii2-filemanager without Composer
On this page you can find all versions of the php package jakharbek/yii2-filemanager. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jakharbek/yii2-filemanager
More information about jakharbek/yii2-filemanager
Files in jakharbek/yii2-filemanager
Informations about the package yii2-filemanager
File Manager
File Manager
Installation
The preferred way to install this extension is through composer.
Either run
or add
to the require section of your composer.json
file.
Usage
Once the extension is installed, simply use it in your code by :
Migrations
You need to do the migration
Module
You need to connect the module of the backend part app.\jakharbek\filemanager\backend\Module
Params
You need to add parameters to the application in the file. example
thumbs
- thumbnails images
images_ext
- images ext
use_file_name
- When uploading a file, whether to use the file name in the file download or create a hash
use_queue
- When uploading a file, is it necessary to use a queue to load some photos in the background mode?
Apply DI (dependency injection)
There is a class \jakharbek\filemanager\bootstrap\SetUp
you need to apply it to the initial download of the application as an example.
Ways to use
There are two ways to use you can use using a relation in a database or a column in a table:
Method use via the relation
Suppose you have a junction table for example
And let's say you have the appropriate relational methods in Active Record
And now you need to apply special behavior jakharbek\filemanager\behaviors\FileRelationBehavior
for such cases.
For example:
You will need to create a property for exchanging data between the form and the model in case it found file_image
or
Next, you need to add this property file_image
to the rules of the model as safe
.
For example:
Now you can apply a file load/upload widget jakharbek\filemanager\widgets\FileInput
for this field.
For example
Use without a junction table
I assume that you already have fields in the table for storing file identifiers there. The type of this column should be a string, since file identifiers will be stored there through a separator for example we have images column for posts table
In this case, you can immediately use the widget without any model settings.
For example:
Use in CKEditor
To use the plug-in file manager in the editor, you need to specify this plug-in in the settings as shown in the example. For example:
After you need to run once this code to launch a modal window when you click a button in the editor
Helpers
You have to help the class jakharbek\filemanager\helpers\FileManagerHelper
There is one method that you will often use in my opinion:FileManagerHelper::getFilesById
API
The extension has an API, you can connect it and get access to the file manager via the API
jakharbek\filemanager\api\FilesController
If you need an action of this controller, you can use them by looking at the action method of this class.
All versions of yii2-filemanager with dependencies
kartik-v/yii2-sortable-input Version v1.2.1
kartik-v/yii2-editable Version v1.7.8
kartik-v/yii2-widget-fileinput Version v1.0.9
2amigos/yii2-ckeditor-widget Version ^2.1
yiisoft/yii2-imagine Version ~2.1.0
yiisoft/yii2-queue Version ^2.0
yiisoft/yii2-redis Version ~2.0.0