GithubHelp home page GithubHelp logo

Comments (3)

schmunk42 avatar schmunk42 commented on September 15, 2024

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.

atrandafir avatar atrandafir commented on September 15, 2024

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:
image

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.

schmunk42 avatar schmunk42 commented on September 15, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.