Giter Site home page Giter Site logo

Comments (4)

mootensai avatar mootensai commented on May 14, 2024

Could you give me an example file tree for what you want? I think it will make the form is not flexible. But maybe i'm not understand it enough..

from yii2-enhanced-gii.

mootensai avatar mootensai commented on May 14, 2024

I don't know if I can do what you want. Because it seems impossible, because everything is depends on the app goals. If I generate to single template, it will not be flexible. Maybe to get what you want, you have to build your own template.
Or maybe, I just not really understand what you suggest..

Thank you

from yii2-enhanced-gii.

arjenmeijer avatar arjenmeijer commented on May 14, 2024

There are two solutions to write reusable code:
a. use classes like Humhub: extend the default classes by adding your own code and use the new classes as start point. This way repeated code is not needed. The newly created class has the code once.
b. use a generator like this one. The code is generated every time over and over again.

I prefer a combination of both. Make new classes for the generator and build from that. This eliminates double code and uses the generator for the unique parameters.

from yii2-enhanced-gii.

mootensai avatar mootensai commented on May 14, 2024

If you want the generator to generate from your base model, you can change the base model at form to your defined model..

  1. create a Model class file that extends from yii\db\ActiveRecord
  2. change the base model class to your created Model when you use IO Model generator
    capture

then all your models are inherited from 1 base model so the generator is already combination of both your solution

from yii2-enhanced-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.