Home >PHP Framework >YII >What does gii in yii mean?

What does gii in yii mean?

青灯夜游
青灯夜游Original
2020-07-18 11:29:003270browse

In Yii, gii is an extension that automatically generates code through gii and leaves some common codes to the program to generate, which greatly reduces the developer's time cost.

What does gii in yii mean?

The Gii extension is undoubtedly a great help for the rapid development of yii2. By using gii to generate code, the development time and cost are greatly saved.

But gii also has some disadvantages, that is, the generated code is the template that comes with yii2. The code generated every time is not what we want, so we have to make corresponding adjustments every time.

So how to use the gii extension component?

To use gii in yii, you need to enable the gii extension in the configuration file first. Find the main.php file in the config directory under the current project. You will see that as shown in the figure below, gii is blocked. Comment, if you need to enable it, you need to remove the comment

What does gii in yii mean?

What does gii in yii mean?

You need to enter a password before you can operate it. The password is just under main.php gii Where to set the extension

What does gii in yii mean?

It should be noted that it is not safe to open the gii extension and may be exploited by hackers. It is recommended to turn off the gii extension after the project is completed

Now log in to gii

What does gii in yii mean?

Let’s create a module first, as shown below

What does gii in yii mean?

What does gii in yii mean?

What does gii in yii mean?

What does gii in yii mean?

First click Preview, then click Generate

What does gii in yii mean?

Then we go to the project directory Take a look below

What does gii in yii mean?

#You can see that the current module is the one we just created, then let’s use this module, open the controller, and then we create a method (test method)

1What does gii in yii mean?

#Then let’s check again. If a 404 page appears when accessing, it means that this module does not exist, so you need to add the specified module to gii. Name

1What does gii in yii mean?

1What does gii in yii mean?

Then let’s check again, http://local.yii.com/web/index.php? r=module name/default/test

1What does gii in yii mean?

1What does gii in yii mean?

If the above two pictures appear, it proves that gii is opened successfully.

Recommended related article tutorials: "yii Framework Tutorial", "PHP Tutorial"

The above is the detailed content of What does gii in yii mean?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn