Comments (3)
If implemented, it should go into a separate folder here https://github.com/yiisoft/yii2-gii/tree/master/src/generators/crud
But we'd have to maintain two sets of views then.
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.
from yii2-gii.
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):
atrandafir@6ae6a69
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 GridView
does not seem to break, at least not for now, but maybe in the future it will, and it would be required to be included into https://github.com/yiisoft/yii2-bootstrap5 repo.
from yii2-gii.
This current views are barebone HTML, I do not think it's a viable way just to re-map some CSS and PHP classes.
In theory it would be nice, but CSS frameworks also rely on markup sometimes.
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 gii
, have a look at https://github.com/schmunk42/yii2-giiant
from yii2-gii.
Related Issues (20)
- CRUD generator template issue - view/update/delete raises error HOT 2
- grud generator gives error for if we give 'crm' for I18N HOT 1
- need checkAccessCallback HOT 1
- Change in Model Generator className to Class HOT 3
- Gii enhancement idea for model-generator HOT 7
- Enh: Redirect to previous page after update HOT 8
- Generator trim validator causes exception in PHP 8.1.9 HOT 9
- still exist calls to className() in templates
- composer issue to trim validator HOT 1
- update readme links
- update .github folder link
- update docs folder link
- update src folder link
- update root folder link
- The table does not exist: uacademy_persona. Model generator throws an error. HOT 17
- parent::init() should be called in yii\gii\components\ActiveField::init() HOT 4
- gii/model --tableName="*" will generate activeRecord for table that I do not need it,like table `migrations` HOT 1
- update irc link
- update src folder links
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yii2-gii.