jacmoe/yii2-gii-jade Jade Gii Generator for Yii2

giijade

Jade Gii Generator for Yii2

Latest Stable Version Total Downloads Latest Unstable Version License

Works well with Yii2 Tale Jade, the Tale Jade for PHP integration for the Yii2 framework.

Installation with Composer

Installation is recommended to be done via composer by running:

composer require jacmoe/yii2-gii-jade "*"

Configuration

Add it to your configuration (frontend/config/main-local.php and/or backend/config/main-local.php for the advanced template).

Add the generator

if (!YII_ENV_TEST) {
  // configuration adjustments for 'dev' environment
  $config['bootstrap'][] = 'debug';
  $config['modules']['debug'] = 'yii\debug\Module';

  $config['bootstrap'][] = 'gii';
  $config['modules']['gii'] = [
    'class' => 'yii\gii\Module',
    'allowedIPs' => ['127.0.0.1', '::1', '192.168.0.*', '192.168.178.20'],
    'generators' => [
      'jadecrud' => [
        'class' => 'jacmoe\giijade\crud\Generator',
        'templates' => [
          'myCrud' => '@jacmoe/giijade/crud/default',
        ]
      ]
    ],
  ];
}

Set defaultExtension

'components' => [
    ...
    ],
    'view' => [
        'defaultExtension' => 'jade',
    ...

Alternatively, if you don't want to set the default extension for the views, then you need to explicitly set the extension in your views/controllers.

For instance:

public function actionAbout()
{
    return $this->render('about.jade');
}
...
$this->render('_form.jade', ['model' => $model,])

Known Bugs

When the i18n option is turned on for the generator, there will be an error in update.jade that looks like this:

-$view->title = Yii::t('app', 'Update {modelClass}: ', [
    'modelClass' => 'User',
]) . ' ' . $model->id

You need to remove the line breaks, like this:

-$view->title = Yii::t('app', 'Update {modelClass}: ', ['modelClass' => 'User',]) . ' ' . $model->id

License

The Jade Gii Generator for Yii2 is released under the MIT license.

Statistics

Downloads
GitHub Stars
GitHub Forks

Releases

Comments



0.2.0 is the latest of 6 releases



MIT license
Stats
0 github stars & 0 github forks
0 downloads in the last day
0 downloads in the last 30 days
89 total downloads