demo icon indicating copy to clipboard operation
demo copied to clipboard

how to add backend for the app?

Open TiaNex-Com opened this issue 5 years ago • 7 comments
trafficstars

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

TiaNex-Com avatar Oct 01 '20 10:10 TiaNex-Com

What do you mean by "add backend"?

samdark avatar Oct 01 '20 10:10 samdark

just like the backend of yii2-app-advanced

TiaNex-Com avatar Oct 01 '20 11:10 TiaNex-Com

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.

samdark avatar Oct 01 '20 12:10 samdark

@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.

jasonkovacs-tim avatar Jun 29 '21 17:06 jasonkovacs-tim

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

rustamwin avatar Jul 25 '21 06:07 rustamwin

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

jasonkovacs-tim avatar Sep 22 '21 16:09 jasonkovacs-tim

@jasonkovacs-tim eventually.

samdark avatar Sep 22 '21 19:09 samdark