PHP Classes

File: README.md

Recommend this page to a friend!
  Classes of Insolita   Yii2 Giitwig   README.md   Download  
File: README.md
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: Yii2 Giitwig
Implement CRUD applications using Twig templates
Author: By
Last change:
Date: 2 months ago
Size: 1,900 bytes
 

Contents

Class file image Download

Gii Twig -Crud

Gii Twig Template Generator (Port default yii2-gii templates) (Without i18N support yet)

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist insolita/yii2-giitwig "*"

or add

"insolita/yii2-giitwig": "*"

to the require section of your composer.json file.

Usage

Twig settings

'view'=>[
            'class'=>'yii\web\View',
            'renderers'=>[
                'twig' => [
                    'class' => 'yii\twig\ViewRenderer',
                    'cachePath' => '@runtime/Twig/cache',
                    'options' => [
                        'auto_reload' => true,
                    ],
                    'globals' => ['html' => '\yii\helpers\Html','arhelp'=>'\yii\helpers\ArrayHelper','url'=>'yii\helpers\Url'],
                    'uses' => ['yii\bootstrap'],],
            ]

]

Gii settings

$config['modules']['gii'] = [
        'class'=>'yii\gii\Module',
        'generators' => [
            'twigcrud' => [
                'class' => 'insolita\giitwig\crud\Generator', // generator class
                'templates' => [
                    'twigCrud' => '@insolita/giitwig/crud/default',
                ]
            ]
        ],
    ];

for customize - copy files from @insolita/giitwig/crud/default to any place, customize and add

$config['modules']['gii'] = [
        'class'=>'yii\gii\Module',
        'generators' => [
            'twigcrud' => [
                'class' => 'insolita\giitwig\crud\Generator', // generator class
                'templates' => [
                    'twigCrud' => '@insolita/giitwig/crud/default',
                    'twigcustomCrud' => '@your/path/to/crud/customized',
                ]
            ]
        ],
    ];