I am new to Yii framework.
I have downloaded Yii2, and Yii2 Advanced Application.
I want to create 2 URLs for front and for admin panel.
Front-end URL: http://localhost/advanced
Back-end URL: http://localhost/advanced/admin
How can I do this?
I am new to Yii framework.
I have downloaded Yii2, and Yii2 Advanced Application.
I want to create 2 URLs for front and for admin panel.
Front-end URL: http://localhost/advanced
Back-end URL: http://localhost/advanced/admin
How can I do this?
I know i am late to answer but i want to help other guys which are new to Yii2. I hope my points will be helpful.
The advanced application template was never designed to do that because it is two separate applications that requires two separate domains (subdomain for 'admin' is fine).
What you want to use instead is yii2-app-practical-a which does exactly what you want. :)
You have the main application you can access by your main URL - http://localhost/advanced and a back-end you can access by the main URL with admin appended: http://localhost/advanced/admin.
The url routing subject is quite broad. You should start by reading the detailled documentation http://www.yiiframework.com/doc-2.0/guide-runtime-routing.html
Basically, you register an
urlManager
component in the application config. In the following example,front
andadmin
are 2 controllers with an index action.