You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. Gii Extension for Yii 2
  2. ========================
  3. This extension provides a Web-based code generator, called Gii, for Yii 2 applications.
  4. You can use Gii to quickly generate models, forms, modules, CRUD, etc.
  5. This repository is a git submodule of <https://github.com/yiisoft/yii2>.
  6. Please submit issue reports and pull requests to the main repository.
  7. For license information check the [LICENSE](LICENSE.md)-file.
  8. Installation
  9. ------------
  10. The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
  11. Either run
  12. ```
  13. php composer.phar require --dev --prefer-dist yiisoft/yii2-gii
  14. ```
  15. or add
  16. ```
  17. "yiisoft/yii2-gii": "~2.0.0"
  18. ```
  19. to the require-dev section of your `composer.json` file.
  20. Usage
  21. -----
  22. Once the extension is installed, simply modify your application configuration as follows:
  23. ```php
  24. return [
  25. 'bootstrap' => ['gii'],
  26. 'modules' => [
  27. 'gii' => 'yii\gii\Module',
  28. // ...
  29. ],
  30. // ...
  31. ];
  32. ```
  33. You can then access Gii through the following URL:
  34. ```
  35. http://localhost/path/to/index.php?r=gii
  36. ```
  37. or if you have enabled pretty URLs, you may use the following URL:
  38. ```
  39. http://localhost/path/to/index.php/gii
  40. ```
  41. Using the same configuration for your console application, you will also be able to access Gii via
  42. command line as follows,
  43. ```
  44. # change path to your application's base path
  45. cd path/to/AppBasePath
  46. # show help information about Gii
  47. yii help gii
  48. # show help information about the model generator in Gii
  49. yii help gii/model
  50. # generate City model from city table
  51. yii gii/model --tableName=city --modelClass=City
  52. ```