Giter Site home page Giter Site logo

mootensai / yii2-enhanced-gii Goto Github PK

View Code? Open in Web Editor NEW
201.0 36.0 100.0 437 KB

Enhanced Yii2 Gii (generator) that generates related Models & CRUD

License: MIT License

PHP 100.00%
generator php-framework yii2 yii2-extension php gii crud model scaffolding

yii2-enhanced-gii's Introduction

yii2-enhanced-gii

Yii2 Gii (generator) with Relation

Latest Stable Version License Total Downloads Monthly Downloads Daily Downloads Join the chat at https://gitter.im/mootensai/yii2-enhanced-gii Yii2

Support

Support via Gratipay

https://www.paypal.me/yohanesc

Endorse me on LinkedIn

https://www.linkedin.com/in/yohanes-candrajaya-b68394102/

Installation

The preferred way to install this extension is through composer.

Either run

$ composer require mootensai/yii2-enhanced-gii:dev-master
$ composer require kartik-v/yii2-mpdf:dev-master # if you want to use pdf exporter 
$ composer require kartik-v/yii2-tree-manager:dev-master # if you want to use tree/nested relation table

or add

"mootensai/yii2-enhanced-gii": "dev-master",
"kartik-v/yii2-mpdf": "dev-master",
"kartik-v/yii2-tree-manager": "dev-master"

add "kartik-v/yii2-mpdf": "dev-master", if you want to use pdf exporter

add "kartik-v/yii2-tree-manager": "dev-master", if you want to use tree/nested relation table

to the require section of your composer.json file.

I separate the mpdf & tree-manager because the package is big & not everyone will use it.

Then you must add this code at your config\main.php.

'modules' => [
... //your another module
      'gridview' => [
          'class' => '\kartik\grid\Module',
          // see settings on http://demos.krajee.com/grid#module
      ],
      'datecontrol' => [
          'class' => '\kartik\datecontrol\Module',
          // see settings on http://demos.krajee.com/datecontrol#module
      ],
      // If you use tree table
      'treemanager' =>  [
          'class' => '\kartik\tree\Module',
          // see settings on http://demos.krajee.com/tree-manager#module
      ]
... // your another module
    ],

See gridview settings on http://demos.krajee.com/grid#module

See datecontrol settings on http://demos.krajee.com/datecontrol#module

See treemanager settings on http://demos.krajee.com/tree-manager#module (If you use tree/nested relation table)

Usage :

Go to your gii tools, and notice the new IO Generator for models & CRUD

Features

Model :

  1. Generate optimistic lock
  2. Generate Timestamp Behaviors
  3. Generate Blameable Behavior
  4. Generate UUID Behavior
  5. Generate Soft Delete Behavior (NEW! Todo : Generate data filtering for relation data, e.g. not show deleted children of hasMany )

CRUD :

  1. Generate all CRUD with wildcard (*) of table
  2. Generate related input output
  3. Specify your name/label attribute for foreign keys
  4. Set your column to hidden
  5. Specify your skipped columns
  6. Specify your skipped relations
  7. Set pluralize or not
  8. PDF Printable view
  9. Expandable / collapsible row at index grid view for related data

Migration Generator :

  1. Generate migration from your database structure (based on : https://github.com/deesoft/yii2-gii)
  2. Option to generate with safeUp() and safeDown()

To Do

  1. One-page-CRUD template
  2. Implement generator for Soft Delete Behavior (https://github.com/yii2tech/ar-softdelete)

I'm open for any improvement

Screenshot

Model Generator

enhanced gii - model

CRUD Generator

enhanced gii - crud

Index

Grid View

enhanced gii - index grid

List View

enhanced gii - index list

View

enhanced gii - view

Form

enhanced gii - create

enhanced gii - update

Nested / Tree

enhanced gii - nested

Migration Generator

migration form

Thanks To

  1. Jiwanndaru ([email protected]) for creating the tradition
  2. kartik-v (https://github.com/kartik-v) for most of widgets
  3. schmunk42 (https://github.com/schmunk42) for bootstrap & model base & extension
  4. mdmunir (https://github.com/mdmunir) for JsBlock & Migration Generator (from https://github.com/deesoft/yii2-gii)

yii2-enhanced-gii's People

Contributors

bitdeli-chef avatar cgernert avatar derekisbusy avatar drew1two avatar gvasilopulos avatar mootensai avatar scrutinizer-auto-fixer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yii2-enhanced-gii's Issues

Error when using kartik\range\RangeInput;

If I use

field($model, 'motiefbestaandoel')->widget(RangeInput::classname(), [ options' => ['placeholder' => 'Select range ...'], 'html5Options' => ['min'=>0, 'max'=>100, 'step'=>1], ]); ?>

in a form, I get error:
Invalid Parameter – yii\base\InvalidParamException
app\models\Spelrondeactievegroepen has no relation named "spelrondeactievegroepen-motiefbestaandoel-source".

Caused by: Unknown Method – yii\base\UnknownMethodException
Calling unknown method: app\models\Spelrondeactievegroepen::getspelrondeactievegroepen-motiefbestaandoel-source()

in /var/www/html/pro.3de5.nl/vendor/yiisoft/yii2/base/Component.php at line 285

  1. in /var/www/html/pro.3de5.nl/vendor/mootensai/yii2-relation-trait/RelationTrait.php at line 26 – yii\db\BaseActiveRecord::getRelation('spelrondeactievegroepen-motiefbe...')

If I replace the Rangeinput with a normal input field, the form works fine.

Do I have specify something extra when using this ranginput widget?

Add if statement in view

In a view view.php the relations are sometime empty and are useless.
Please add an if statement to check if it is empty to skip the block.

    if ($providerNameXXX->totalCount > 0) {
          echo Gridview::widget([
          'dataProvider' =>

CRUD _form not getting correct namespace for kartik\widgets\DatePicker

New CRUD generation with a date field incorrectly generates a non-qualified namespace for Kartik's DatePicker which causes a load error ( PHP Fatal Error – yii\base\ErrorException
Class 'DatePicker' not found.)

Please either add 'use kartik\widgets\DatePicker; ' to the _file's use statements on generation, or add the fully qualified namespace to the 'type' configuration option.

Thanks for resolving the last issues you all just worked on btw!

field($model, 'assignment_date')->widget(\kartik\widgets\DatePicker::classname(), [ 'options' => ['placeholder' => Yii::t('app', 'Choose Assignment Date')], 'type' => **DatePicker::**TYPE_COMPONENT_APPEND, // <--needs a qualified namespace 'pluginOptions' => [ 'autoclose' => true, 'format' => 'dd-M-yyyy' ] ]); ?>

Duplicated code

The _form.php code is generated in each setup. That implies that if I change a field, I have to change it in a lot of places. That is hardly doable if the code grows.

Moreover, the views are manually tweaked with bootstrap columns. Like

        <div class="row">
            <div class="col-sm-6">
            <?= $form->field($model, 'namefield')->textInput() ?>
            </div>

or in an index view columns are not displayed.

Is it possible to reuse the original form code (by including this code).

Unknown method deleteWithChildren when attempting to delete record

I've created the CRUD for a model and am able to insert, view and update the record, but when I try to delete the record, I get: Calling Unknown Method: frontend\models\Entity::deleteWithChildren()

If I generate the CRUD using the normal Gii generator, there is no error.

Model Class name always reset to the tabel name

I can change the class name, but the generated class name is always identical to the table name.
They should be independent after the input is made. I should have the opportunity to have an other class name.

Request: Add checkbox behaviour logged in user only. Standard code is below.

public function behaviors()
{
   return [
        'verbs' => [
            'class' => VerbFilter::className(),
            'actions' => [
                'delete' => ['post'],
             ],
        ],
        'access' => [
            'class' => AccessControl::className(),
            'rules' => [
                [
                    'allow' => true,
                    'actions' => ['index', 'view', 'create', 'update','delete'],
                    'roles' => ['@']
                ],
                [
                    'allow' => false
                ]
            ]
        ]
    ];
}

A minor correction

In views index.php the code generated is:

<?= GridView::widget([
    'dataProvider' => $dataProvider,
    'filterModel' => $searchModel,
    'columns' => $gridColumn,
    'pjax' => true,
    'pjaxSettings' => ['options' => ['id' => 'kv-pjax-container']],
    'panel' => [
        'type' => GridView::TYPE_PRIMARY,
//        'heading' => '<h3 class="panel-title"><i class="glyphicon glyphicon-tasks"></i>  ' . Html::encode($this->title) . ' </h3>'
        'heading' => '<span class="glyphicon glyphicon-tasks"></span>  ' . Html::encode($this->title)
    ],

Replace the commented out line with the new line. h3 is already coded in the heading. So, it is double right now and leads to 'incorrect' html.

Request for view and update details

You added the details view to the generator. Very nice.

To make this even better I am trying to implement the view and edit screens in a detail view. I have it more or less working. But not everything is working fine: Errors are not shown in the details view, the submit button in not enabled/disabled and after an update the key is lost.

Are you interested to add this feature as well. I can send you my code.

incorrect namespace generated in Controller

This example assumes a model class called Entity.

use statement incorrectly generated as:
use EntitySearch;
the correct statement should be the qualified namespace that the user enters on gii form:
use frontend\models\EntitySearch;

namespace is incorrectly generated as:
use EntitySearch;
the correct use statement should include the qualified namespace that the user enters on the gii form: use frontend\models\EntitySearch;

The view file does not exist: /mootensai/yii2-enhanced-gii/crud/default/views/_expand.php

  1. in /var/www/html/protest.3de5.nl/vendor/yiisoft/yii2/base/View.php
  2. in /var/www/html/protest.3de5.nl/vendor/yiisoft/yii2-gii/Generator.php at line 317 – yii\base\View::renderFile(
  3. in /var/www/html/protest.3de5.nl/vendor/mootensai/yii2-enhanced-gii/crud/Generator.php at line 389 – yii\gii\Generator::render
  4. in /var/www/html/protest.3de5.nl/vendor/yiisoft/yii2-gii/controllers/DefaultController.php at line 45 – mootensai\enhancedgii\crud\Generator::generate()
    yii\gii\controllers\DefaultController::actionView('enhanced-gii-crud')

_expand,php not found when generating the crud. Latest dev version.

Preview Gii Error

There is an error whenever I try to preview my crud (before I generate it) as these images below:

gii2

And here is the error:

gii1

Request: Use Growl message after generation of code

The generation screen is large, so it is impossible to see if a generation is successful without scrolling.
Make the message a growl message and the problem is solved.

use kartik\widgets\Growl;

echo Growl::widget([
'type' => Growl::TYPE_SUCCESS,
'title' => 'Succes',
'icon' => 'glyphicon glyphicon-ok-sign',
'body' => 'Generation of xxxx was succesful.',
'showSeparator' => true,
'delay' => 0, // wait time
'pluginOptions' => [
'showProgressbar' => false,
'delay' => 5000, // time on screen
'placement' => [
'from' => 'top',
'align' => 'right',
]
]
]);

View loading error when a table contains relation and some data

I'm using the package with the details as image below:

mo

So, in case I have 2 tables with the structures as below:

===============
|   table_a        
===============
|   id                        
|  description          
===============

And table_b with 1 foreign key refer to table_a

===============
|   table_b        
===============
|   table_a_id          
|  description          
===============

At first, it has no error when the table_a & table_b have no data. But then when these tables have some data, I cannot open the index & view. So much issues since then. You might want to try it.

mootensai/jsblock * -> no matching package found.

Your requirements could not be resolved to an installable set of packages.

Problem 1
- Installation request for mootensai/yii2-enhanced-gii * -> satisfiable by mootensai/yii2-enhanced-gii[0.0.1].
- mootensai/yii2-enhanced-gii 0.0.1 requires mootensai/jsblock * -> no matching package found.

Not uploaded yet?

Relations Problem

Hi, i'am always getting the following error:
¨Please fix the following errors: Data can't be deleted because it's still used by another data.¨
when i'm trying to insert or update data. I have the foreign key relations established correctly on my db. What could be the problem?
sorry if its a dumb question i'am still new to yii2.

How to regenerate _data.php ?

I am not a programmer

I get this error : Invalid Parameter – yii\base\InvalidParamException The view file does not exist ....\views\escale_data.php

I deleded views folder escale, escale models file and escale controllers file to generate news
"_data.php" seems to be generated one time but not regenerated when new generate are done...

Could you tell me how to regenerate "_data.php" ?

Hello Moo

Just a minor issue --->
line 25
$relName = ($isHasMany) ? lcfirst($key) . 's' : lcfirst($key);

['id' => 'kv-pjax-container']] => id should be unique on a page.

Example generated code:
echo Gridview::widget([
'dataProvider' => $providerX,
'pjax' => true,
'pjaxSettings' => ['options' => ['id' => 'kv-pjax-container']],
'panel' => [ ...
The generated id is always «kv-pajax-container» in a view file even if there multiple containers.
Make the id unique: add a number of name to it.

Update/View buttons broken if table/model has composite primary keys

When creating a view using a model with a composite primary key, the composite key is not copied over to the 'Update' button on the View or Index pages which causes the buttons to break (with a composite key; because Yii is looking for the ID's of the composite keys too.

As a workaround:
If for example, your additional primary keys (besides id) are entity_id and label_id, the primary keys must be added to the 'update' button's code in the View file, like so:

$model['id'], **'entity_id' => $model['entity_id'], 'label_id' => $model['label_id'**]], ['class' => 'btn btn-primary']) ?>

Some informatie over One-page-CRUD template requested

In a _form.php file you generate for example:

\mootensai\components\JsBlock::widget(['viewFile' => '_script', 'pos'=> \yii\web\View::POS_END, 
    'viewParams' => [
        'class' => 'Classname', 
        'relID' => 'clasname', 
        'value' => \yii\helpers\Json::encode($model->classnames),
        'isNewRecord' => ($model->isNewRecord) ? 1 : 0
    ]
]);

and

 <div class="form-group" id="add-classname"></div>`

This are preparation to make a one-page-crud? What is the purpose? Can I use it yet by hand?

tabel prefix?

I am using a prefix in my table names: tbl_.
I do not use the Yii2 prefix, but this does not matter.
I generate class names without tbl_ as is recommended.

This setup is not possible in enchanced-gii. The code generated always gives classes the tbl prefx name.
Is it possible to give the table name a prefix, but the class names no prefix?

Add auto-hints in the model (with checkbox to select it)

Add to the model:
public function attributeHints() {
return ['name' => "My hint for the model attribute 'name'."];
}

Generate for each attribute a default hint. Afterwards I only need to change the hint itself, not the code.

Duplicated code try 2

Problem: add one field to a table with six relations.

Required actions: Or generate the complete model again (no option for me) or add the field to the table and generate only the changed table again. But the problem is that I have add the new field to all six relation models because each table has its own _dataNametable.php and formNametable.php in the view of the related table.

Solution: Place _dataNametable.php and formNametable.php once in a subdirectory of view of the table. Refer in all relations only to these files.

Benefits: No code duplication, changes in just one place, easier to find bugs, ...

Blameable behaviors have wrong default namespace for User

When generating models with blameable behaviors on an advanced Yii2 platform, the blameable behaviors incorrectly default to frontend\models namespace but the user models are in common\models by default.

Some people may move their User models to other namespaces as well other than common\models or frontend\models. Perhaps an area to specify the namespace for the blameable behaviors would be nice?

Tabs

Is was trilled to see the tabs in the create form.

However, how do I generate tabs? Do I have to add them manually with the tabs widget?

Add add-name class to accesControl behavior

If a users checks the option: «Logged User Only» (Rename it to Logged in Uses Only) the generator has to add
add-nameclasses to the allowed rules.

'rules' => [ [ 'allow' => true, 'actions' => ['index', 'view', 'create', 'update','delete', 'add missing controller actions add-nametable], 'roles' => ['moderator', 'admin'] ],

Otherwise, the extra table views in the create and edit forms will not show.

Wrong namespace generated by CRUD generator for Search model

Hi. Thanks for a GREAT addition to Yii2. It's a real time saver.

When I create new CRUD for a model, the namespace for the Search model won't change to reflect the namespace that I put into the Gii form. It always says 'frontend' in the final generated documents, instead of what I put into the form which is 'frontend\models'.

For example, in the Gii CRUD page, I created a new CRUD model class called 'entity'. I select 'Generate Search Model' and change the Search Model Namespace to 'frontend\model' which works great for the Model Namespace and the Controller namespace, but in Search model will only generate 'frontend' for the namespace when I generate the classes, even though I've entered 'frontend\models.'

In the interim, can I just use the regular Gii CRUD generator to generate the Search model alone? Is the Search model code that is generated by the Enhanced Gii Generator the same as the regular Gii Search model?

Installation error: kartik-v/yii2-export v1.2.2 requires phpoffice/phpexcel 1.8.0

When installing the yii2-enhanced-gii I receive the following error. phpoffice/phpexcell is in my application already present in the latest version 1.8.1 (composer.json: "phpoffice/phpexcel": "dev-master").

Your requirements could not be resolved to an installable set of packages.

Problem 1
- kartik-v/yii2-export v1.2.2 requires phpoffice/phpexcel 1.8.0 -> no matching package found.
- kartik-v/yii2-export v1.2.1 requires phpoffice/phpexcel 1.8.0 -> no matching package found.
- kartik-v/yii2-export v1.2.0 requires phpoffice/phpexcel 1.8.0 -> no matching package found.
- kartik-v/yii2-export v1.1.0 requires phpoffice/phpexcel 1.8.0 -> no matching package found.
- kartik-v/yii2-export v1.0.0 requires phpoffice/phpexcel 1.8.0 -> no matching package found.
- Installation request for mootensai/yii2-enhanced-gii dev-master -> satisfiable by mootensai/yii2-enhanced-gii[dev-master].
- mootensai/yii2-enhanced-gii dev-master requires kartik-v/yii2-export * -> satisfiable by kartik-v/yii2-export[dev-master, v1.0.0, v1.1.0, v1.2.0, v1.2.1, v1.2.2, v1.2.3].
- kartik-v/yii2-export dev-master requires phpoffice/phpexcel ~1.8.0 -> satisfiable by phpoffice/phpexcel[1.8.x-dev].
- kartik-v/yii2-export v1.2.3 requires phpoffice/phpexcel ~1.8.0 -> satisfiable by phpoffice/phpexcel[1.8.x-dev].
- Conclusion: don't install phpoffice/phpexcel 1.8.x-dev

Potential causes:

Read https://getcomposer.org/doc/articles/troubleshooting.md for further common problems.

Installation failed, reverting ./composer.json to its original content.

Views are put in incorrect place when using backend\views

When I create CRUD and change the namespace to backend, the views are created in the frontend with a backend namespace.

For example, if I were to create CRUD for frontend\models, that works fine. But if I change the namespace to backend\models, it still creates the views, but in the frontend\models folder (with the correct backend\models namespace.)

error after upgrading yii2-relation-trait 1.0.8

[22-Feb-2016 15:43:18 Asia/Jakarta] PHP Fatal error: Can't use function return value in write context in /home/k2681793/public_html/demo002/vendor/mootensai/yii2-relation-trait/RelationTrait.php on line 39

How to solve this error? Thanks

I am lost with queries and search

It is getting better and better. Thank you!

However, I do not understand the query and search options. That is, the query option generates an include like:
use app\models\Name;
use NameQuery;
Hence, the query class is not found, as it should be in app\models.

update: You are using different namespaces. Can I read somewhere an overview of your thinking and setup?

Moreover, if I change it manually, I run into troubles with query and search classes.
Default search is used, but you use query. Why the name change?

if I generate an active record query class I get the error:
Missing argument 1 for yii\db\ActiveQuery::__construct(), called in /var/www/html/pro.3de5.nl/controllers/NameController.php on line 35 and defined

Generate model does not generate anything.

Generating code using template "/var/www/html/profiel.3de5.nl/vendor/mootensai/yii2-enhanced-gii/model/default"...
skipped models/base/app/models/Vergelijkprofielen.php
skipped models/app/models/Vergelijkprofielen.php
skipped models/app/models/VergelijkprofielenQuery.php
done!

So the message is: generated successful, but I do not know why it skipped the models. The path looks very strange: models/apps/models? The original input is only the class name. Not model/base/app/models
Something strange is going on.

Grid Settings specify Font Awesom in some places

The generated settings for the grids specify Font Awesome in some cases, other case is not specified. Font Awesome is not installed by default (I think). Kartik-V has the option to use that but it's not part of the composer packaging so for the Export menu's on the index.php page the icons don't show. On pages were a foreign key creates a tabular grid it does not specify Font Awesome so the icons in the export menu show up since they are defaulted to glyph icons.

I added the Kartik icon frame work to my project and that fixed up the index.php page. In view.php I added a couple of lines of code to also use Font Awesome. -

<?php
    $gridColumnModel = [
        ['class' => 'yii\grid\SerialColumn'],
        ['attribute' => 'id', 'hidden' => true],
        [
            'attribute' => 'fkMake.id',
            'label' => 'Make',
        ],
        'ed_id',
        'model_name',
        'nice_name',
        'year',
        'processed_state',
        'dte_update',
    ];
    echo Gridview::widget([
        'dataProvider' => $providerModel,
        'pjax' => true,
        'pjaxSettings' => ['options' => ['id' => 'kv-pjax-container']],
        'panel' => [
        'type' => GridView::TYPE_PRIMARY,
        'heading' => '<h3 class="panel-title"><i class="glyphicon glyphicon-book"></i>  ' . Html::encode('Model'.' '. $this->title) . ' </h3>',
        ],
        'columns' => $gridColumnModel,

         // Added the export options  here
         'export' => [
            'fontAwesome' => true,
        ],
    ]);
?>

In any case I think either add the code to set to use Font Awesome or set default to not use it.

Just started looking at the generator, looks cool.

Sandy

Can not install kartik-v/yii2-grid version 3.0.6

Expect: kartik-v/yii2-grid version 3.0.6 installed
Outcome: kartik-v/yii2-grid version 3.0.2 is chosen by composer

Not sure if this is kartik-v extensions issue or mootensai's extension issue.
Should probably set require to @dev instead of '*'

Where to put model rules()?

Where to put model rules()?
Should i put it on base model or extended model?
Do you like to change your generated rules?
I think i'll put it on the extended model?
What do you guys think?

kartik\Datecontrol instead of kartik\Datepicker

This is more a suggestion, discard it if you prefer. I think it would be interesting to use kartik\Datecontrol instead of kartik\Datepicker for date fields. It´s far more generic and indeed you still can use datepicker within it.

By the way, thank you. Your extension rocks!

Request for details tab

Thank you for making the details visible in an index view. That is really wonderful.

It would be even better if the first tab would be a detail view of selected line. Most files I user are to large to view in one index line. So I display only the most important fields. It would be wonderful to see the details in a tab without using the view button. Just like the relations.

Do not use relations in the _detail.php view

In the view _detail.php the generators writes for example, where «rollen» is a relation:
[ 'attribute' => 'rollen.rol_id', 'label' => Yii::t('app', 'Rol'), ],

This give a error: Getting unknown property: app\models\Functieinorganisatie::rollen

The error is that the generator made a relation:

    public function getRol()
    {
        return $this->hasOne(\app\models\Rollen::className(), ['rol_id' => 'rol_id']);
    }

Not getRollen(). I do not know why this happens.

Likewise, In view.php

          [
                'attribute' => 'functieinorganisatie.functie_id',
                'label' => Yii::t('3de5', 'Functie')
        ],

gives the same error in a subview of a table. The view itself is functieinorganisatie. So one way or another it is calling itself. Mmmm.

Incorrect PHPDoc generated for Blameable Behaviors

When creating a model and adding the Blameable Behavior, the PHPDoc that is created in the class is incorrect in the return type. 'Type' should be the return type of the function. It is currently generated like below and highlighted in bold. I believe the return type should be 'mixed.'

/**
* @inheritdoc
* @return type array
*/
public function behaviors()
{
return [
[
'class' => TimestampBehavior::className(),
'createdAtAttribute' => 'created_at',
'updatedAtAttribute' => 'updated_at',
'value' => new\yii\db\Expression('NOW()'),
],
[
'class' => BlameableBehavior::className(),
'createdByAttribute' => 'created_by_id',
'updatedByAttribute' => 'updated_by_id',
],
];
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.