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 4.0KB

8 vuotta sitten
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. Yii 2 Advanced Application Template
  2. ===================================
  3. Yii 2 Advanced Application Template is a skeleton Yii 2 application best for
  4. developing complex Web applications with multiple tiers.
  5. The template includes three tiers: front end, back end, and console, each of which
  6. is a separate Yii application.
  7. The template is designed to work in a team development environment. It supports
  8. deploying the application in different environments.
  9. DIRECTORY STRUCTURE
  10. -------------------
  11. ```
  12. common
  13. config/ contains shared configurations
  14. mail/ contains view files for e-mails
  15. models/ contains model classes used in both backend and frontend
  16. console
  17. config/ contains console configurations
  18. controllers/ contains console controllers (commands)
  19. migrations/ contains database migrations
  20. models/ contains console-specific model classes
  21. runtime/ contains files generated during runtime
  22. backend
  23. assets/ contains application assets such as JavaScript and CSS
  24. config/ contains backend configurations
  25. controllers/ contains Web controller classes
  26. models/ contains backend-specific model classes
  27. runtime/ contains files generated during runtime
  28. views/ contains view files for the Web application
  29. web/ contains the entry script and Web resources
  30. frontend
  31. assets/ contains application assets such as JavaScript and CSS
  32. config/ contains frontend configurations
  33. controllers/ contains Web controller classes
  34. models/ contains frontend-specific model classes
  35. runtime/ contains files generated during runtime
  36. views/ contains view files for the Web application
  37. web/ contains the entry script and Web resources
  38. widgets/ contains frontend widgets
  39. vendor/ contains dependent 3rd-party packages
  40. environments/ contains environment-based overrides
  41. tests contains various tests for the advanced application
  42. codeception/ contains tests developed with Codeception PHP Testing Framework
  43. ```
  44. REQUIREMENTS
  45. ------------
  46. The minimum requirement by this application template that your Web server supports PHP 5.4.0.
  47. INSTALLATION
  48. ------------
  49. ### Install from an Archive File
  50. Extract the archive file downloaded from [yiiframework.com](http://www.yiiframework.com/download/) to
  51. a directory named `advanced` that is directly under the Web root.
  52. Then follow the instructions given in "GETTING STARTED".
  53. ### Install via Composer
  54. If you do not have [Composer](http://getcomposer.org/), you may install it by following the instructions
  55. at [getcomposer.org](http://getcomposer.org/doc/00-intro.md#installation-nix).
  56. You can then install the application using the following command:
  57. ~~~
  58. php composer.phar global require "fxp/composer-asset-plugin:1.0.0"
  59. php composer.phar create-project --prefer-dist --stability=dev yiisoft/yii2-app-advanced advanced
  60. ~~~
  61. GETTING STARTED
  62. ---------------
  63. After you install the application, you have to conduct the following steps to initialize
  64. the installed application. You only need to do these once for all.
  65. 1. Run command `init` to initialize the application with a specific environment.
  66. 2. Create a new database and adjust the `components['db']` configuration in `common/config/main-local.php` accordingly.
  67. 3. Apply migrations with console command `yii migrate`. This will create tables needed for the application to work.
  68. 4. Set document roots of your Web server:
  69. - for frontend `/path/to/yii-application/frontend/web/` and using the URL `http://frontend/`
  70. - for backend `/path/to/yii-application/backend/web/` and using the URL `http://backend/`
  71. To login into the application, you need to first sign up, with any of your email address, username and password.
  72. Then, you can login into the application with same email address and password at any time.