yii2-giiant | Yii 2 Framework Code Generator Gii on Steroids | Generator Utils library
kandi X-RAY | yii2-giiant Summary
kandi X-RAY | yii2-giiant Summary
Giiant is an extended code-generator for models and CRUDs, based upon Gii (Yii 2.0 Framework). It creates prototypes for database models and backends including relations defined by foreign-key constrains in no-time. To provide a highly flexible configuration system it features a callback-provider-queue to define rendering of customized inputs, columns or attribute values. A main project goal is porting many features and learnings from gtc, giix, awecrud and other code-generators into one solution.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Render relation editable .
- Render relation grid .
- Get model relations .
- Extract translations from relation table .
- Function to fill the form
- Generate fake value .
- Bootstrap the module .
- Generate a dropdown field .
- Shortcut for shorthand attribute format
- Format date field .
yii2-giiant Key Features
yii2-giiant Examples and Code Snippets
Community Discussions
Trending Discussions on yii2-giiant
QUESTION
ANSWER
Answered 2017-Oct-25 at 07:26You can not use
viaTable()
twice on the same relation. The second call will overwrite the first one. If you want to go over more than a junction table you need via(). You can however define multiple relations, one of them usingvia()
and the other usingviaTable()
.I have no idea how giiant works, but it may detect a Many-Many relation through the fact that
viaTable()
is used.viaTable()
in contrast tovia()
skips one table so you do not need an ActiveRecord for the junction table. Withvia()
you always define direct relations.About the order of keys in relation definitions, please check the docs at
http://www.yiiframework.com/doc-2.0/guide-db-active-record.html#declaring-relations
[...] the link between the two types of data: specifies the column(s) through which the two types of data are related. The array values are the columns of the primary data (represented by the Active Record class that you are declaring relations), while the array keys are the columns of the related data.
An easy rule to remember this is, as you see in the example above, you write the column that belongs to the related Active Record directly next to it. You see there that customer_id is a property of Order and id is a property of Customer.
QUESTION
I am using the command line for generating models with giiant, like this:
...ANSWER
Answered 2017-Apr-06 at 09:21When using the batch command
QUESTION
My question may look like the following question:
yii2 - model load function does not set some model attributes
However, the case here is different due to dealing with Many to Many relation through junction table.
For instance, I have three tables, Jobs
, Eqtypes
and the junction table Eqtype_jobs
. I want to relate some Eqtypes
to a current Job
using simple activeform
using multiple select dropDownList
. The following is the code that I have in, the controller and the view:
ANSWER
Answered 2017-Mar-04 at 05:29Check your model validation rulse and post parameter, is your model validate rulses?
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install yii2-giiant
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page