Commit 0ae15e22 by Carsten Brandt

some typos and grammar for Gii

parent df023545
......@@ -135,28 +135,28 @@ By default there are the following generators available:
After choosing a generator by clicking on the "Start" button you will see a form that allows you to configure the
parameters of the generator. Fill out the form according to your needs and press the "Preview" button to get a
preview of the code that gii is about to generated. Depending on the generator you chose and whether the files
preview of the code that Gii is about to generate. Depending on the generator you chose and whether the files
already existed or not, you will get an output similar to what you see in the following picture:
![Gii preview](images/gii-preview.png)
Clicking on the file name you can view a preview of the code that will be generated for that file.
When the file already exists, gii also provides a diff view that shows what is different between the code that exists
When the file already exists, Gii also provides a diff view that shows what is different between the code that exists
and the one that will be generated. In this case you can also choose which files should be overridden and which not.
> Tip: When using the Model Generator to update models after database change, you can copy the code from gii preview
> Tip: When using the Model Generator to update models after database change, you can copy the code from Gii preview
and merge the changes with your own code. You can use IDE features like PHPStorms
[compare with clipboard](http://www.jetbrains.com/phpstorm/webhelp/comparing-files.html), [Aptana Studio](http://www.aptana.com/products/studio3/download) or [Eclipse](http://www.eclipse.org/pdt/) based editor also allows [compare with clipboard](http://andrei.gmxhome.de/anyedit/examples.html) by using [AnyEdit tools plugin](http://andrei.gmxhome.de/anyedit/) for this, which allows you to merge in relevant changes and leave out others that may revert your own code.
After you have reviewed the code and selected the files to be generated you can click the "Generate" button to create
the files. If all went fine you are done. When you see errors that gii is not able to generate the files you have to
the files. If all went fine you are done. When you see errors that Gii is not able to generate the files you have to
adjust directory permissions so that your webserver is able to write to the directories and create the files.
> Note: The code generated by gii is only a template that has to be adjusted to your needs. It is there
> Note: The code generated by Gii is only a template that has to be adjusted to your needs. It is there
to help you create new things quickly but it is not something that creates ready to use code.
We often see people using the models generated by gii without change and just extend them to adjust
some parts of it. This is not how it is meant to be used. Code generated by gii may be incomplete or incorrect
We often see people using the models generated by Gii without change and just extend them to adjust
some parts of it. This is not how it is meant to be used. Code generated by Gii may be incomplete or incorrect
and has to be changed to fit your needs before you can use it.
......@@ -164,9 +164,10 @@ Creating your own templates
---------------------------
Every generator has a form field `Code Template` that lets you choose a template to use for code generation.
By default gii only provides one template `default` but you can create your own templates that are adjusted to your needs.
By default Gii only provides one template `default` but you can create your own templates that are adjusted to your needs.
If you open the folder `@app\vendor\yiisoft\yii2-gii\generators`, you'll see six folders of generators.
If you open a folder `@app\vendor\yiisoft\yii2-gii\generators`, you'll see six folders of generators.
```
+ controller
- crud
......@@ -176,9 +177,10 @@ If you open a folder `@app\vendor\yiisoft\yii2-gii\generators`, you'll see six f
+ model
+ module
```
This is generator name. If you open any of these folders, you can see the folder `default`. This folder is name of the template.
Copy folder `@app\vendor\yiisoft\yii2-gii\generators\crud\default` to another location, for example `@app\myTemplates\crud\`.
These names are the generator names. If you open any of these folders, you can see the folder `default`, which is the name of the template.
Copy the folder `@app\vendor\yiisoft\yii2-gii\generators\crud\default` to another location, for example `@app\myTemplates\crud\`.
Now open this folder and modify any template to fit your desires, for example, add `errorSummary` in `views\_form.php`:
```php
......@@ -194,7 +196,7 @@ Now open this folder and modify any template to fit your desires, for example, a
//...
```
Now you need to tell GII about our template. The setting is made in the config file:
Now you need to tell Gii about our template. The setting is made in the config file:
```php
// config/web.php for basic app
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment