php - Yii2 advanced, when to use the frontend folder and when the backend folder?
Get the solution ↓↓↓I recently started learning the yii2 framework for my internship in the advanced template. But I don't really get when you need to use the backend folder instead of the frontend folder. If someone could explain it, it would be appreciated.
Answer
Solution:
Its verry easy.
Backend is your admin page, and frontend is your user page.
Let me explain.
You have models, what your backend use, and frontend use. If both have to use, you have to use common folder to share models with back and frontend.
When you make an app, in frontend you can create everything, what user need. Like registration, login, about us, etc.
In backend this will be your admin page. Like user search, modify rows, etc.
If any of your model need to user, and to admin, like user table, you have to use common folder. Then frontend, and backend will see this model. Be carefull with roules.
I hope i helped. :)
Answer
Solution:
Frontend is typically what is presented to end user, the project itself. Backend is admin panel... https://www.yiiframework.com/extension/yiisoft/yii2-app-advanced/doc/guide/2.0/en/structure-applications
Answer
Solution:
Common - This directory used for common functionalities i.e. if we want to use same functionality in both backend and frontend in that case we can use this.
Frontend - This directory is used to create the website that is presented to end user.
Backend - This directory is used to implement the interface to manage that website (admin panel).
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: illegal string offset
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.