Download the PHP package zolotarev/yii2-giiant without Composer

On this page you can find all versions of the php package zolotarev/yii2-giiant. 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-giiant

yii2-giiant

Extended models and CRUDs for Gii, the code generator of Yii2 Framework

PROJECT IS IN BETA STAGE!

What is it?

Giiant provides templates for model and CRUD generation with relation support and a sophisticated UI. A main project goal is porting many features and learnings from gtc, giix, awecrud and others into one solution.

Installation

The preferred way to install this extension is through composer.

composer.phar require schmunk42/yii2-giiant:"*"

The generators are registered automatically in the application bootstrap process, if the Gii module is enabled

Usage

Visit your application's Gii (eg. index.php?r=gii and choose one of the generators from the main menu screen.

For basic usage instructions see the Yii2 Guide section for Gii.

Command Line Batches

You can run batches of base-model and CRUD generation with the build in batch command:

./yii giiant-batch --tables=profile,social_account,user,token

It will process the given tables, for more details see ./yii help giiant-batch. See the Sakila example for a detailed example.

Features

Model generator

CRUD generator

Providers

Customization with providers

In many cases you want to exchange i.e. some inputs with a customized version for your project. Examples for this use-case are editors, file-uploads or choosers, complex input widget with a modal screen, getting data via AJAX and so on.

With Giiant Providers you can create a queue of instances which may provide custom code depending on more complex rules. Take a look at some existing giiant providers.

Configure providers, add this to your provider list in the form:

\schmunk42\giiant\crud\providers\EditorProvider,
\schmunk42\giiant\crud\providers\SelectProvider,
\schmunk42\giiant\crud\providers\OptsProvider,

And configure the settings of the provider, add setting via dependecy injection this to your application config, eg. in console/config/bootstrap.php:

\Yii::$container->set(
    'schmunk42\giiant\crud\providers\EditorProvider',
    [
        'columnNames' => ['description']
    ]
);

This will render a Ckeditor widget for every column named description.

<?= $form->field($model, 'description')->widget(
\dosamigos\ckeditor\CKEditor::className(),
[
    'options' => ['rows' => 6],
    'preset' => 'basic'
]) ?>

NOTE The OptsProvider matches every model with opts methods for a field, i.e. method optsMembers matches for model attribute members.

Using "prompt" in dropdown lists

Set the first entry in your getColumnName() method to value null.

null => \Yii::t('app', 'Select'),

To ensure that the correct value is written to the database you should add a validation rule in the model.

public function rules()
{
    return ArrayHelper::merge(
        parent::rules(),
        [
            [
                ['field_name'],
                'default',
                'value' => null
            ]
        ]
    );
}

Universal CallbackProvider

This provider has three properties activeFields (form), columnFormats (index) and attributeFormats (view) which all take an array of callback as input. The keys are evaluated as a regular expression the match the class and attribute name. While the callback function takes the current attribute and generator as input parameters.

The configuration can be done via the dependency injection container of Yii2.

Define callbacks for input fields in _form view

Define callbacks for grid columns in index view

Detail view attributes

Finally add the configuration via DI container

More providers...

Use custom generators, model and crud templates

Extras

A detailed description how to use MySQL workbench for model updates and migration see here.

Special thanks to motin, thyseus, uldisn and rcoelho for their work, inspirations and feedback.

Troubleshooting

You can also add

"repositories": [
  {
    "type": "vcs",
    "url": "https://github.com/schmunk42/yii2-giiant.git"
  }
],
"require": {
    .....(your required modules)....
    "schmunk42/yii2-giiant":"dev-master"
},

to your composer.json file and run

composer update

if you are having trouble with "Not found" errors using the preferred method.

Screenshots

giiant-0 2-screen-1 giiant-0 2-screen-2

Links


All versions of yii2-giiant with dependencies

PHP Build Version
Package Version
Requires dmstr/yii2-bootstrap Version *
yiisoft/yii2 Version ~2.0.4
yiisoft/yii2-gii Version ~2.0.4
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 zolotarev/yii2-giiant contains the following files

Loading the files please wait ....