Skip to content
This repository was archived by the owner on Apr 11, 2023. It is now read-only.

Commit ccf3404

Browse files
committed
v0.1.0
1 parent 8460aaa commit ccf3404

File tree

24 files changed

+385
-193
lines changed

24 files changed

+385
-193
lines changed

.gitattributes

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Ignore all test and documentation for archive
22
/.gitattributes export-ignore
33
/.gitignore export-ignore
4-
/tests export-ignore
5-
/documentation export-ignore
4+
/yii export-ignore
5+
/yii.bat export-ignore
6+
/config export-ignore
7+
/documentation export-ignore
8+
/tests export-ignore

CHANGELOG.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
11
Yii2 RBAC Change Log
22
====================
33

4+
Version 0.1.0
5+
--------------
6+
- Update menu
7+
- Add Config
8+
- Add AppAsset
9+
410
Version 0.0.13
5-
-------------=
11+
--------------
612
- Fix bug on menu
713

8-
914
Version 0.0.12
10-
-------------=
15+
--------------
1116
- Fix bug
1217

13-
1418
Version 0.0.11
15-
-------------=
19+
--------------
1620
- Added "badge" on Readme.md
1721

18-
1922
Version 0.0.1
2023
-------------
21-
Initial release
24+
Initial release

config/bootstrap.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?php
2+
Yii::setAlias('@diecoding', dirname(__DIR__));

config/console.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
return [
4+
'id' => 'console',
5+
'basePath' => dirname(__DIR__),
6+
'bootstrap' => ['log'],
7+
'components' => [
8+
'log' => [
9+
'targets' => [
10+
[
11+
'class' => 'yii\log\FileTarget',
12+
'levels' => ['error', 'warning'],
13+
],
14+
],
15+
],
16+
],
17+
];

config/language.php

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
<?php
2+
3+
/**
4+
* Configuration file for 'yii message/extract' command.
5+
*
6+
* This file is automatically generated by 'yii message/config' command.
7+
* It contains parameters for source code messages extraction.
8+
* You may modify this file to suit your needs.
9+
*
10+
* You can use 'yii message/config-template' command to create
11+
* template configuration file with detailed description for each parameter.
12+
*/
13+
return [
14+
// string, required, root directory of all source files
15+
'sourcePath' => dirname(__DIR__) . DIRECTORY_SEPARATOR . 'src',
16+
17+
// Root directory containing message translations.
18+
'messagePath' => dirname(__DIR__) . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'languages',
19+
20+
// array, required, list of language codes that the extracted messages
21+
// should be translated to. For example, ['zh-CN', 'de'].
22+
'languages' => [
23+
'en',
24+
'id',
25+
],
26+
27+
// string, the name of the function for translating messages.
28+
// Defaults to 'Yii::t'. This is used as a mark to find the messages to be
29+
// translated. You may use a string for single function name or an array for
30+
// multiple function names.
31+
'translator' => 'Yii::t',
32+
33+
// boolean, whether to sort messages by keys when merging new messages
34+
// with the existing ones. Defaults to false, which means the new (untranslated)
35+
// messages will be separated from the old (translated) ones.
36+
'sort' => true,
37+
38+
// boolean, whether to remove messages that no longer appear in the source code.
39+
// Defaults to false, which means each of these messages will be enclosed with a pair of '@@' marks.
40+
'removeUnused' => true,
41+
42+
// array, list of patterns that specify which files/directories should NOT be processed.
43+
// If empty or not set, all files/directories will be processed.
44+
// A path matches a pattern if it contains the pattern string at its end. For example,
45+
// '/a/b' will match all files and directories ending with '/a/b';
46+
// the '*.svn' will match all files and directories whose name ends with '.svn'.
47+
// and the '.svn' will match all files and directories named exactly '.svn'.
48+
// Note, the '/' characters in a pattern matches both '/' and '\'.
49+
// See helpers/FileHelper::findFiles() description for more details on pattern matching rules.
50+
'only' => [
51+
'*.php',
52+
],
53+
54+
// array, list of patterns that specify which files (not directories) should be processed.
55+
// If empty or not set, all files will be processed.
56+
// Please refer to "except" for details about the patterns.
57+
// If a file/directory matches both a pattern in "only" and "except", it will NOT be processed.
58+
'except' => [
59+
'.svn',
60+
'.git',
61+
'.gitignore',
62+
'.gitkeep',
63+
'.hgignore',
64+
'.hgkeep',
65+
'/languages',
66+
'/BaseYii.php',
67+
],
68+
69+
// 'php' output format is for saving messages to php files.
70+
'format' => 'php',
71+
// boolean, whether the message file should be overwritten with the merged messages
72+
'overwrite' => false,
73+
74+
/*
75+
// 'db' output format is for saving messages to database.
76+
'format' => 'db',
77+
// Connection component to use. Optional.
78+
'db' => 'db',
79+
// Custom source message table. Optional.
80+
'sourceMessageTable' => '{{%source_message}}',
81+
// Custom name for translation message table. Optional.
82+
'messageTable' => '{{%message}}',
83+
*/
84+
85+
/*
86+
// 'po' output format is for saving messages to gettext po files.
87+
'format' => 'po',
88+
// Root directory containing message translations.
89+
'messagePath' => __DIR__ . DIRECTORY_SEPARATOR . 'messages',
90+
// Name of the file that will be used for translations.
91+
'catalog' => 'messages',
92+
// boolean, whether the message file should be overwritten with the merged messages
93+
'overwrite' => true,
94+
*/
95+
96+
// 'color' => null,
97+
'interactive' => true,
98+
// 'help' => null,
99+
'markUnused' => true,
100+
'ignoreCategories' => [
101+
'yii',
102+
],
103+
// 'phpFileHeader' => '',
104+
// 'phpDocBlock' => null,
105+
];

config/main.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
return [
3+
'aliases' => [
4+
'@bower' => '@vendor/bower-asset',
5+
'@npm' => '@vendor/npm-asset',
6+
],
7+
'vendorPath' => dirname(__DIR__) . '/vendor',
8+
'components' => [
9+
'cache' => [
10+
'class' => 'yii\caching\FileCache',
11+
],
12+
],
13+
];

src/AppAsset.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
namespace diecoding\rbac;
4+
5+
use yii\web\AssetBundle;
6+
7+
/**
8+
* Main asset bundle.
9+
*/
10+
class AppAsset extends AssetBundle
11+
{
12+
/**
13+
* @inheritdoc
14+
*/
15+
public $sourcePath = '@diecoding/rbac/assets';
16+
17+
/**
18+
* @inheritdoc
19+
*/
20+
public $css = [
21+
'css/style.min.css',
22+
];
23+
}

src/Module.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ public function init()
5151
];
5252
}
5353

54+
AppAsset::register(Yii::$app->view);
55+
5456
$this->controllerMap = [
5557
'menu' => [
5658
'class' => 'diecoding\rbac\controllers\MenuController',

src/assets/css/style.css

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/**
2+
* @author Die Coding (Sugeng Sulistiyawan) <[email protected]>
3+
* @copyright 2019 Die Coding
4+
* @license MIT
5+
* @link https://www.diecoding.com
6+
* @version 0.0.1
7+
*/
8+
9+
pre {
10+
white-space: pre-wrap; /* Since CSS 2.1 */
11+
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
12+
white-space: -pre-wrap; /* Opera 4-6 */
13+
white-space: -o-pre-wrap; /* Opera 7 */
14+
word-wrap: break-word; /* Internet Explorer 5.5+ */
15+
}

src/assets/css/style.min.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)