Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
89626899
Commit
89626899
authored
Dec 17, 2013
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adjusted Gii guide to mention a bit different config structure of a basic application
parent
ed7b7db8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
7 deletions
+39
-7
gii.md
docs/guide/gii.md
+39
-7
No files found.
docs/guide/gii.md
View file @
89626899
...
...
@@ -8,7 +8,8 @@ as well as complete CRUD controllers.
Installing and configuring
--------------------------
Gii comes as an offical extension and the preferred way to install this extension is through
[
composer
](
http://getcomposer.org/download/
)
.
Gii comes as an offical extension and the preferred way to install this extension is through
[
composer
](
http://getcomposer.org/download/
)
.
Either run
...
...
@@ -42,13 +43,44 @@ http://localhost/path/to/index.php?r=gii
> Note: if you are accessing gii from another IP than localhost, access will be denied by default.
You have to add allowed IPs to the configuration in this case:
```php
'gii' => [
'class' => 'yii\gii\Module',
'allowedIPs' => ['127.0.0.1', '::1', '192.168.0.*', '192.168.178.20'] // adjust this to your needs
],
```
```
php
'gii'
=>
[
'class'
=>
'yii\gii\Module'
,
'allowedIPs'
=>
[
'127.0.0.1'
,
'::1'
,
'192.168.0.*'
,
'192.168.178.20'
]
// adjust this to your needs
],
```
### Basic application
In basic application template configuration structure is a bit different so Gii should be configured in
`config/web.php`
:
```
php
// ...
if
(
YII_ENV_DEV
)
{
// configuration adjustments for 'dev' environment
$config
[
'preload'
][]
=
'debug'
;
$config
[
'modules'
][
'debug'
]
=
'yii\debug\Module'
;
$config
[
'modules'
][
'gii'
]
=
'yii\gii\Module'
;
// <--- here
}
```
So in order to adjust IP address you need to do it like the following:
```
php
if
(
YII_ENV_DEV
)
{
// configuration adjustments for 'dev' environment
$config
[
'preload'
][]
=
'debug'
;
$config
[
'modules'
][
'debug'
]
=
'yii\debug\Module'
;
$config
[
'modules'
][
'gii'
]
=
[
'class'
=>
'yii\gii\Module'
,
'allowedIPs'
=>
[
'127.0.0.1'
,
'::1'
,
'192.168.0.*'
,
'192.168.178.20'
],
];
}
```
How to use it
-------------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment