Download the PHP package coksnuss/yii2-gii-modelgen without Composer

On this page you can find all versions of the php package coksnuss/yii2-gii-modelgen. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package yii2-gii-modelgen

yii2-gii-modelgen

A tweaked model generator for the Gii module of the Yii 2 framework. The generator re-uses Gii-native code wherever possible and thus has a high chance of retaining all the latest changes of Gii without the need for an update. When checked for the last time, the generator retains the full featureset of Gii 2.0.8.

What this extension does

This extension basically adds three features to gii's basic model template generator:

  1. The generated models are splitted into a base model and a concrete model. Whenever the database structure is changed (e.g. through a migration) the base model can simply be overridden by the newly generated model. No custom code is touched. All custom code is written into the concrete model which is used throughout the application and extends the base model.
  2. A new option is added to directly integrate the timestamp behavior into models by providing the column names of the created_at and updated_at column.
  3. When generating models for all tables using the wildcard operator * the migration table is omitted.
  4. In addition to the model class, it is possible to generate a query class. (This feature is now natively supported by Gii)

In addition, the template files were slightly adapted:

  1. The tableName() function within the generated model classes is only generated if it is required, i.e., if default implementation of ActiveRecord::tableName() is insufficient.
  2. When generating a query class, it does not contain any boilerplate functions.

Installation

First this extension needs to be included via composer by issuing the following console command within the root directory of your yii2 project:

composer require --prefer-dist "coksnuss/yii2-gii-modelgen"

Furthermore Gii needs to know of the newly available model template. This is achieved by modifying the corresponding configuration file

[...]
'class' => 'yii\gii\Module',
'generators' => [
    'model' => ['class' => 'coksnuss\gii\modelgen\generators\model\Generator'],
],
[...]

Thats it.


All versions of yii2-gii-modelgen with dependencies

PHP Build Version
Package Version
Requires yiisoft/yii2 Version ~2.0
yiisoft/yii2-gii Version ~2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package coksnuss/yii2-gii-modelgen contains the following files

Loading the files please wait ....