Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to add backend for the app? #147

Open
TiaNex-Com opened this issue Oct 1, 2020 · 7 comments
Open

how to add backend for the app? #147

TiaNex-Com opened this issue Oct 1, 2020 · 7 comments
Labels
type:docs Documentation

Comments

@TiaNex-Com
Copy link

start a new project? any suggestions?

What steps will reproduce the problem?

What is the expected result?

What do you get instead?

Additional info

Q A
Version 1.0.?
PHP version
Operating system
@samdark
Copy link
Member

samdark commented Oct 1, 2020

What do you mean by "add backend"?

@TiaNex-Com
Copy link
Author

just like the backend of yii2-app-advanced

@samdark
Copy link
Member

samdark commented Oct 1, 2020

In a similar way i.e. create another entry point etc. but there's almost no need for it in Yii 3 since it's way more flexible about directory structure.

@jasonkovacs-tim
Copy link

@samdark Could you please describe how we might reorganize a large Yii2 advanced app (backend, frontend, console, and single vendor folder) into a directory structure that is recommended for Yii3? I am reviewing https://github.com/yiisoft/app and this demo, but it is not clear what the migration path is from a Yii2 advanced app to Yii3 single app.

Would each of our top level apps sit side-by-side, each using the Yii3 single app directory structure, so that backend and frontend can each have config/ and a public/ entry point? If that is done, would there need to be multiple sets of vendor/ and composer.json for each of our backend and frontend apps? That seems like a lot of redundancy, though flexible.

Also, we rely heavily on the Yii2 concept of modules and routing with a tiered structure: app > modules > controllers. I see in the demo that src/ has Blog/, and the config/routes.php has a Route Group of /blog and several Blog/*Controller entries named specifically. In Yii3 Routing, is there a concept of pattern matching of a URI path part to a src/ subdirectory "module" and Controller without specifically naming them all in routes.php? Could you provide an example of this pattern structure? This is unclear from https://github.com/yiisoft/router. Thank you.

@rustamwin
Copy link
Member

rustamwin commented Jul 25, 2021

We recently added host support to the router, now you can split the admin (aka backend) by specifying the host. For example:

Group::create()->routes(
    // your admin routes here.
)->host('admin.{_host}') // just use FastRoute pattern

@jasonkovacs-tim
Copy link

Will documentation be provided for how to manually migrate a former Yii2 advanced application template to a Yii3 single application?

@rustamwin rustamwin reopened this Sep 22, 2021
@rustamwin rustamwin added type:docs Documentation and removed status:under discussion labels Sep 22, 2021
@samdark
Copy link
Member

samdark commented Sep 22, 2021

@jasonkovacs-tim eventually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:docs Documentation
Projects
None yet
Development

No branches or pull requests

4 participants