-
-
Notifications
You must be signed in to change notification settings - Fork 192
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
Should gii use bootstrap5 assets since both basic and advanced apps are already using it? #528
Comments
If implemented, it should go into a separate folder here https://github.com/yiisoft/yii2-gii/tree/master/src/generators/crud I think this should be left to an extension, since it's basically a configuration thing for your current project. Or ... the app-templates should provide the corresponding CRUD templates. |
I have forked the repo and did some playing around to see what would be a good solution. I've ended up with something like this: You can see the commit here (it is not finished yet): Apparently the only things that can change depending on bootstrap version, are the php classes, or the html classes generated in the views. So with some setup like this, there would be no need to maintain multiple views, because the rest of the code would not change. Also with this in the future maybe even someone could use a different framework than Bootstrap, and configure gii and map all the classes to the corresponding ones. Currently some stuff is breaking from bs 3 that I think was used initially, to bs 5. Mostly the forms "break" because the classes do not match anymore. But the |
This current views are barebone HTML, I do not think it's a viable way just to re-map some CSS and PHP classes. You can simply provide your own templates, see https://github.com/yiisoft/yii2-gii/blob/master/docs/guide/topics-creating-your-own-templates.md For an example how to further extend |
What steps will reproduce the problem?
What's expected?
yii\bootstrap5\ActiveForm;
What do you get instead?
yii\widgets\ActiveForm
Additional info
Comments
I'm wondering if I am doing something wrong. But if not, I think it would be a nice user experience to start the project directly with the right bootstrap version.
I am willing to create a PR for gii if we decide upon a solution. Maybe we could add multiple generator templates for each bootstrap version and ask the user to choose it before generating crud/views?
The text was updated successfully, but these errors were encountered: