Comments (4)
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.
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.
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.
If you want the generator to generate from your base model, you can change the base model at form to your defined model..
- create a Model class file that extends from yii\db\ActiveRecord
- change the base model class to your created Model when you use IO Model generator
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)
- In model generator tinyint create rules as string
- No results found. HOT 1
- Error when the instance of a model is created - Softdelete and Blameable Behavior HOT 1
- Custom Model Template HOT 1
- PHP version HOT 1
- wrong table name generated when table name has "_" in it HOT 1
- When I updated the master record, the child record on all related tables is soft deleted. HOT 1
- Generate migration column tinyint give error result
- Can't detect if in the model function beforesave the object is soft deleted HOT 1
- "Call to a member function getColumnNames() on null" HOT 1
- Open redirect in crud/default/views/_form.php HOT 2
- Models and CRUD generation in batch command HOT 1
- Edit Generator Code HOT 3
- PDOException: SQLSTATE[22007]: Invalid datetime format: 1292 Truncated incorrect DOUBLE value: HOT 2
- Model generation getRelations() bug
- Auto increment primary keys fails HOT 3
- bit, tinyint to boolean
- deletedByValueRestored is always 0
- HasMany: Update > valdiation error Message > update again >The object being updated is outdated. HOT 1
- Switch to twig or another templating engine? HOT 1
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-enhanced-gii.