Webkadabra Media Uploader ¶
Author: Sergii Gamaiunov hello@webkadabra.com ¶
http://webkadabra.com ¶
Download ¶
Get source from https://bitbucket.org/webkadabra/wkd-yii-mediauploader
Installation ¶
1. Preparation ¶
Copy contents of this folder to /path/to/extensions/wkd/components/media-uploader folder
Install MySql schema
See database.sql
Make sure your Yii application has 'wkd' path alias pointed to
/path/to/extensions/wkd/
Usage Example ¶
Add MediaUploader to Controller map in app config:
'controllerMap'=>array(
'mediaUploader'=>array(
'class'=>'wkd.components.media-uploader.MediaUploaderController',
),
),
- Add path alias for tmp uploads folder in config:
'params'=>array(
...
'envTempDir' => 'application.runtime', // uploader temp folder
),
In your views, add uploader widget:
// Uploader, Must be called before RTEditor:
$this->widget('wkd.components.media-uploader.MediaUploaderWidget', array(
'options' => array(
'uploadUrl' => app()->createUrl('mediaUploader/upload', array('modelName' => get_class($model), 'modelID' => $model->id)),
'browseUrl' => app()->createUrl('mediaUploader/index', array('modelName' => get_class($model), 'modelID' => $model->id)),
),
'boundModel' => $model,
#'forceAssetsCache'=>true,
));
- To open up an uploader window, call Javascript helper function
mediaUploaderWindow.open()
cough
just a component
This one is used a lot in our internal project, and I hope later we will release better version. However, it's dependancy on YiiBootstrap is only in views, and you can create your own view.
Please, keep in mind this is more of a "placeholder" release - hopefully, wehn we release all component that are reused a lot in our projects, communirt will be more pleased!
Thanks!
just mentioning
@b3atb0x
Didn't want to sound ungrateful or anything.
Was just posting the comment, as I think it is important to know that it will use some customization to get it running.
Especially the dependency to yiibootstrap should be mentioned up top.
For sth provided to the community the code should not contain inconsistencies like the use of app() instead of Yii::app(), or the alias should be defined in the module itself
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.