Because GiiModule generates new code files on the server, you should only use it on your own development machine. To prevent other people from using this module, it is required that you specify a secret password in the configuration. Later when you access the module via browser, you will be prompted to enter the correct password.

By default, GiiModule can only be accessed by localhost. You may configure its ipFilters property if you want to make it accessible on other machines.

With the above configuration, you will be able to access GiiModule in your browser using the following URL:

http://localhost/path/to/index.php?r=gii

If your application is using path-format URLs with some customized URL rules, you may need to add the following URLs in your application configuration in order to access GiiModule:

Property Details

assetsUrl property

generatorPaths property

public array $generatorPaths;

a list of path aliases that refer to the directories containing code generators. The directory referred by a single path alias may contain multiple code generators, each stored under a sub-directory whose name is the generator name. Defaults to array('application.gii').

ipFilters property

public array $ipFilters;

the IP filters that specify which IP addresses are allowed to access GiiModule. Each array element represents a single filter. A filter can be either an IP address or an address with wildcard (e.g. 192.168.0.*) to represent a network segment. If you want to allow all IPs to access gii, you may set this property to be false (DO NOT DO THIS UNLESS YOU KNOW THE CONSEQUENCE!!!) The default value is array('127.0.0.1', '::1'), which means GiiModule can only be accessed on the localhost.

newDirMode property

public integer $newDirMode;

the permission to be set for newly generated directories. This value will be used by PHP chmod function. Defaults to 0777, meaning the directory can be read, written and executed by all users.

newFileMode property

public integer $newFileMode;

the permission to be set for newly generated code files. This value will be used by PHP chmod function. Defaults to 0666, meaning the file is read-writable by all users.

password property

public string $password;

the password that can be used to access GiiModule. If this property is set false, then GiiModule can be accessed without password (DO NOT DO THIS UNLESS YOU KNOW THE CONSEQUENCE!!!)