YCM - Yii Content Management module
See examples for all the options.
protected/modules/ycm
protected/config/main.php
. Enable module, set username, password and models you want to manage. 'modules'=>array(
...
'ycm'=>array(
'username'=>'YOUR USERNAME',
'password'=>'YOUR PASSWORD',
'registerModels'=>array(
//'application.models.Blog', // one model
'application.models.*', // all models in folder
),
'uploadCreate'=>true, // create upload folder automatically
'redactorUpload'=>true, // enable Redactor image upload
),
...
),
You can also use composer.
{
"name": "app-name",
"description": "App description",
"type": "project",
"prefer-stable": true,
"require": {
"php": ">=5.3.0",
"yiisoft/yii": "1.1.14",
"janisto/yii-ycm": "1.1.0",
}
}
'aliases'=>array(
'vendor'=>realpath(__DIR__ . '/../../vendor'),
),
'modules'=>array(
...
'ycm'=>array(
'class' =>'vendor.janisto.yii-ycm.YcmModule',
'username'=>'YOUR USERNAME',
'password'=>'YOUR PASSWORD',
'registerModels'=>array(
//'application.models.Blog', // one model
'application.models.*', // all models in folder
),
'uploadCreate'=>true, // create upload folder automatically
'redactorUpload'=>true, // enable Redactor image upload
),
...
),
...
function behaviors() {
return array(
'file' => array(
'class'=>'application.modules.ycm.behaviors.FileBehavior',
//'uploadPath'=>'/optional/path/to/uploads',
//'uploadUrl'=>'http://optional.cdn.domain.com/uploads/path',
),
);
}
...
$model = new Model;
echo $model->getFilePath('attribute');
echo $model->getFileUrl('attribute');
echo $model->getAbsoluteFileUrl('attribute');
yii-ycm is free and unencumbered public domain software.
Comments