vova07 / yii2-start

Yii2-Start application
Other
274 stars 115 forks source link

Add controller to the backend #132

Closed davidoff77vt closed 9 years ago

davidoff77vt commented 9 years ago

I know that more then an issue of ur great work is everything my fault :)

I want use yii2-start as base for a project, my problem is that i need to add some controllers to the frontend and the backend.

How can i do it?

sorry for my silly question

vova07 commented 9 years ago

Hi @davidoff77vt , Your problem can be solved really easy.

Here is a small instruction for future:

Good to know:

  1. First of all you may understand that Yii2-Start is an application template like basic and advanced, with only minimal structure for work. It's almost like Advanced structure just with small difference in config logic.
  2. So, if Yii2-Start is a template, we can use it, exactly like Advanced one.
  3. Like in Advanced you're free to modify, add and remove un/needed folders and files.

Simple instruction:

  1. Create a new folder in our ***end directory. For example: /frontend/controllers/
  2. Use GII to create a new model.
  3. Use GII to generate our first CRUD controller and views.
  4. Add missed URL rules to our ***endconfig. For example: In /frontend/config/main.php we can add some universal rules like '<_c>/<_a>' => '<_c>/<_a>'
  5. Open in our browser the new controller: http://yii2-start.com/controller/action/
  6. Profit!

Conclusion

It's exactly like in official doc.

davidoff77vt commented 9 years ago

Thanks. Reading the closed issues i have found the solution but u were faster then me answering.