File tree Expand file tree Collapse file tree 4 files changed +25
-0
lines changed
modules/admin/views/layouts Expand file tree Collapse file tree 4 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ DIRECTORY STRUCTURE
3434- Content management components: cms, comments
3535- Yii2 component for logging cron jobs
3636- Account page
37+ - Key-value storage component
3738
3839
3940REQUIREMENTS
Original file line number Diff line number Diff line change 1414 'rbac ' => [
1515 'class ' => 'yii2mod\rbac\Module ' ,
1616 ],
17+ 'settings-storage ' => [
18+ 'class ' => 'yii2mod\settings\Module ' ,
19+ ],
1720 ]
1821 ],
1922 'comment ' => [
2023 'class ' => 'yii2mod\comments\Module '
2124 ]
2225 ],
2326 'components ' => [
27+ 'settings ' => [
28+ 'class ' => 'yii2mod\settings\components\Settings ' ,
29+ ],
2430 'request ' => [
2531 'cookieValidationKey ' => 'fYPq2eLM ' ,
2632 ],
Original file line number Diff line number Diff line change 11<?php
2+
23use yii \db \Schema ;
34use yii \db \Migration ;
45
@@ -83,6 +84,18 @@ public function up()
8384 'updatedAt ' => time (),
8485 ]);
8586
87+ $ this ->createTable ('{{%Setting}} ' , [
88+ 'id ' => Schema::TYPE_PK ,
89+ 'type ' => Schema::TYPE_STRING . '(10) NOT NULL ' ,
90+ 'section ' => Schema::TYPE_STRING . ' NOT NULL ' ,
91+ 'key ' => Schema::TYPE_STRING . ' NOT NULL ' ,
92+ 'value ' => Schema::TYPE_STRING . ' NOT NULL ' ,
93+ 'status ' => Schema::TYPE_SMALLINT . ' NOT NULL ' ,
94+ 'createdAt ' => Schema::TYPE_INTEGER . ' NOT NULL ' ,
95+ 'updatedAt ' => Schema::TYPE_INTEGER . ' NOT NULL ' ,
96+ ], $ tableOptions
97+ );
98+
8699 $ this ->insert ('{{%Cms}} ' , [
87100 'url ' => 'terms-and-conditions ' ,
88101 'title ' => 'Terms & Conditions ' ,
@@ -289,6 +302,7 @@ public function down()
289302 $ this ->dropTable ('{{%AuthRule}} ' );
290303 //Drop cron table
291304 $ this ->dropTable ('{{%CronSchedule}} ' );
305+ $ this ->dropTable ('{{%Setting}} ' );
292306 $ this ->execute ('SET FOREIGN_KEY_CHECKS=1; ' );
293307 }
294308}
Original file line number Diff line number Diff line change 7373 'label ' => '<i class="glyphicon glyphicon-user"></i> RBAC ' ,
7474 'url ' => ['/admin/rbac ' ],
7575 ],
76+ [
77+ 'label ' => '<i class="glyphicon glyphicon-wrench"></i> Settings Storage ' ,
78+ 'url ' => ['/admin/settings-storage ' ],
79+ ],
7680 [
7781 'label ' => '<i class="glyphicon glyphicon-repeat"></i> Clear Cache ' ,
7882 'url ' => ['/admin/settings/clear-cache ' ],
You can’t perform that action at this time.
0 commit comments