This thing? I was going to move it to yii-web package.
The question is, what is simpler? Just to have a website by default?
The possibility to not have that was brought up in another design discussion.
Several users wanted to be able to start with no assumptions made in advance and ie. just create an API with a CLI.
Adding the web-part to the project template should just be one command, in theory
It would also be nice, if yii-demo
was created from yii-project-template
which is AFAIK not the case.
It’s not the case because yii-project-template
is currently outdated.
The question is whatever we prefer plain simple templates vs package inheritance. For example, yii-base-web
will magically add some routes and their implementation to the application. yii-base-cli
will add some console commands etc. In order to remove/adjust these you’ll have to override some configs.
I can see already questions, how can I enable cli in in my base-web, or how can I enable web in my cli?
If its possible to make it “combined” … would be nice.
That’s why I dislike current template base-web
is not a template, it is used by template.
Yeah, base-web
, base-api
and other bases are merely entrypoints.
I’d vote for keeping the project-template without any code (like it is atm), but build examples like yii2-app-basic
or yii2-app-advanced
from it.
We could move on with generator approach. Then we could have one template, which is almost empty by default, but could easily generate endpoints using command line (provided by separate package). Like vendor/bin/yiiapp web frontend
generates web endpoint under fronted
directory and vendor/bin/yiiapp rest api
will generate REST API endpoint under api
directory. It could be even extended to use community templates (vendor/bin/yiiapp rob006/fancy-web-template fronted
).
Or we can revert to plain template approach such as yii-app-basic. Without any base packages or composition or generation (except gii).
what about symfony skelton,
can include required app templates as composer require dependencies?
Yes. That is possible as well and that’s actually how current template is built. But it seems it leads to no good in our case because it seems to be very confusing.
The idea of template configurator is great, though may be hard to implement & maintain.
You should be able to use the project-template
and create a basic-project-template
from it and commit that again to another repo, which is effectively a fork.
Actually that task should be scriptable.
Actually that’s the idea of the yii-base
(s).
For the purpose of demonstrating complex implementation, a demo would be more suitable than template.
I am not sure what you mean by “demo” - will there be Yii3 demo online with github repo … ? If so, then yes, it would suffice. Actually it’s good idea - adding examples of complex implementations in a one place. One could clone fork git repo as a “new project” and also provide back PRs, if needed.
But there has never been any demo for Yii1 nor Yii2 by now so the concept is new to me.
yii-base
(s) are intended to be used as composer dependencies (at least at this point). I’m proposing automated copy&paste to interactively generate application starter adapted to specific needs. You can always add another endpoint (like API) to your app, but after that it is all yours.
What do you want to adjust for these endpoints (by generation or config)?
I want to work on them, like with yii2-app-advanced
. The point its that if I need only frontend, console, and api, I need to remove unused parts from yii2-app-advanced
and add missing ones. I after 6 months I need to add backend endpoint, I need to do that manually. With the generator approach, this could be automated - I could choose which endpoints want to use in the starter and add new in the future in the same way.