Egorka
6 years ago
39 changed files with 1065 additions and 1193 deletions
@ -1,51 +1,51 @@
|
||||
<?php |
||||
return [ |
||||
'aliases' => [ |
||||
'aliases' => [ |
||||
'@bower' => '@vendor/bower-asset', |
||||
'@npm' => '@vendor/npm-asset', |
||||
], |
||||
'vendorPath' => dirname(dirname(__DIR__)) . '/vendor', |
||||
'controllerMap' => [ |
||||
'vendorPath' => dirname(dirname(__DIR__)) . '/vendor', |
||||
'controllerMap' => [ |
||||
// Common migrations for the whole application |
||||
'migrate' => [ |
||||
'class' => 'yii\console\controllers\MigrateController', |
||||
'class' => 'yii\console\controllers\MigrateController', |
||||
'migrationPath' => [ |
||||
'@console/migrations', |
||||
'@console/migrations', |
||||
], |
||||
], |
||||
], |
||||
'components' => [ |
||||
'cache' => [ |
||||
'class' => 'yii\caching\FileCache', |
||||
'cachePath' => '@common/runtime/cache', |
||||
], |
||||
'authManager' => [ |
||||
'class' => 'yii\rbac\DbManager', |
||||
'itemTable' => '{{%auth_items}}', |
||||
'itemChildTable' => '{{%auth_item_children}}', |
||||
'assignmentTable' => '{{%auth_assignments}}', |
||||
'ruleTable' => '{{%auth_rules}}', |
||||
], |
||||
'components' => [ |
||||
'cache' => [ |
||||
'class' => 'yii\caching\FileCache', |
||||
'cachePath' => '@common/runtime/cache', |
||||
], |
||||
'authManager' => [ |
||||
'class' => 'yii\rbac\DbManager', |
||||
'itemTable' => '{{%auth_items}}', |
||||
'itemChildTable' => '{{%auth_item_children}}', |
||||
'assignmentTable' => '{{%auth_assignments}}', |
||||
'ruleTable' => '{{%auth_rules}}', |
||||
], |
||||
'queue' => [ |
||||
//'class' => 'yii\queue\redis\Queue', |
||||
//'as log' => 'yii\queue\LogBehavior', |
||||
'class' => \yii\queue\file\Queue::class, |
||||
//'path' => '@runtime/queue', |
||||
'path' => '@common/runtime/queue', |
||||
], |
||||
'avatar' => [ |
||||
'class' => \zertex\avatar_generator\AvatarGenerator::class, |
||||
'images_folder' => '@staticRoot/images/avatars', |
||||
'images_url' => '@static/images/avatars', |
||||
'size_width' => 300, // default: 300 |
||||
'font_size' => 200, // default: 200 |
||||
'salt' => 'my_cms_salt', // salt for image file names |
||||
'texture' => ['sun', 'rain'], // texture name |
||||
'texture_over_image' => false, |
||||
'text_over_image' => false, |
||||
], |
||||
'moduleManager' => [ |
||||
'class' => \core\components\modules\ModuleManager::class, |
||||
], |
||||
'queue' => [ |
||||
//'class' => 'yii\queue\redis\Queue', |
||||
//'as log' => 'yii\queue\LogBehavior', |
||||
'class' => \yii\queue\file\Queue::class, |
||||
//'path' => '@runtime/queue', |
||||
'path' => '@common/runtime/queue', |
||||
], |
||||
'avatar' => [ |
||||
'class' => \zertex\avatar_generator\AvatarGenerator::class, |
||||
'images_folder' => '@staticRoot/images/avatars', |
||||
'images_url' => '@static/images/avatars', |
||||
'size_width' => 300, // default: 300 |
||||
'font_size' => 200, // default: 200 |
||||
'salt' => 'my_cms_salt', // salt for image file names |
||||
'texture' => ['sun', 'rain'], // texture name |
||||
'texture_over_image' => false, |
||||
'text_over_image' => false, |
||||
], |
||||
'moduleManager' => [ |
||||
'class' => \core\components\modules\ModuleManager::class, |
||||
], |
||||
], |
||||
]; |
||||
|
@ -1,40 +0,0 @@
|
||||
<?php |
||||
|
||||
namespace core\forms; |
||||
|
||||
use core\entities\Meta; |
||||
use yii\base\Model; |
||||
use Yii; |
||||
|
||||
class MetaFormOrg extends Model |
||||
{ |
||||
public $title; |
||||
public $description; |
||||
public $keywords; |
||||
|
||||
public function __construct(Meta $meta = null, $config = []) |
||||
{ |
||||
if ($meta) { |
||||
$this->title = $meta->title; |
||||
$this->description = $meta->description; |
||||
$this->keywords = $meta->keywords; |
||||
} |
||||
parent::__construct($config); |
||||
} |
||||
|
||||
public function rules(): array |
||||
{ |
||||
return [ |
||||
[['title'], 'string', 'max' => 255], |
||||
[['description', 'keywords'], 'string'], |
||||
]; |
||||
} |
||||
|
||||
public function attributeLabels() { |
||||
return [ |
||||
'title' => Yii::t('main', 'Title'), |
||||
'description' => Yii::t('main', 'Description'), |
||||
'keywords' => Yii::t('main', 'Keywords'), |
||||
]; |
||||
} |
||||
} |
Loading…
Reference in new issue