News

Apr 1, 2017

Locustv2

LinkableBehavior

If you are displaying ActiveRecord on its own route, you can use this extension to make it easier creating URLs. You won't write code like below anymore:

Html::a(
    $user->name, [
        '/user/view',
        'id' => $user->id,
    ],
    [
        'class' => 'text-success'
    ],
);

Instead, it would be $model->hotlink or

$model->getHotlink('view', ['class' => 'text-success']);

Whenever you have to change the route adjust behavior configuration in your ActiveRecord instead of going through your view files updating routes one by one. You can also link to other components or ActiveRecords that use the LinkableBehavior via getHotlinkTo().

Mar 29, 2017

pgaultier

Yii 2.0 Webpack2 integration

This extension allows the use of Webpack2 system to manage assets in Yii 2.

Please check a README and a sample app to understand how to use it.

Mar 28, 2017

bizley-code

Migration extension 2.0 released

Migration v2.0 extension has been released with the ability to generate updating migration based on the current database table structure and table migration history.

Previously Migration was able to generate only creating migrations based on the current database table structure - now it can scan migration history and generate virtual table schema based on it and then compare it with current table structure to generate updating migration.

Mar 27, 2017

samdark

Yii development notes 1-3

Three posts about how Yii development goes from Alexander Makarov from core team:

Mar 27, 2017

samdark

How to Program With Yii2: Running Cron Services

An aricle on how to run background jobs periodically via cron and Yii console controllers.

Mar 25, 2017

samdark

Twig extension 2.1.0 released

A not backwards compatible version 2.1.0 was releaseed. It adds support for scalar global variables, unifies path() and url() syntax to match Url::to() and makes package more flexible by using DI container to instantiating extensions.

Mar 24, 2017

pceuropa

Which Yii 2 project template to choose, basic or advanced?

The article compares basic application template and advanced application template. There are some tips and a good feature chart at the end.

Mar 23, 2017

insperedia

Yii2 PhpStorm plugin was updated

New version provides wide functionality for code completion in Yii arrays. The main improvement is about supporting Yii::createObject() and Object::__construct(). Those methods are widely used in the framework so there are many places where code completion will work much better in these cases:

  • Array in $config parameter of yii\base\Object or its descendants constructor
  • Array that has "class" key containing valid class representation: a fully qualified class name as a string, ClassName::class or Class::className()
  • Array value which refers to one of standard Yii components such as "db", "request", or "mailer". File with this array should be located in a directory called "config"
  • WidgetClass::widget() and WidgetClass::begin() calls if WidgetClass is a descendant of yii\base\Widget
  • $field->widget() method call on yii\widgets\ActiveField and its descendants
  • Inside array in GridView "columns" key
  • Yii::createObject() method

New developer has joined the project so we expect the plugin to develop faster making Yii framework even better.

Mar 18, 2017

salem

AngularJs extension to consume Yii 2.0 RESTful API

angular-yii2-model has been released. It is a simple and lightweight AngularJS 1.x service designed to consume Yii 2.0 RESTful API framework and its built-in HATEOAS.

Mar 11, 2017

samdark

PhpStorm 2017.1 Public Preview

A new PhpStorm Public Preview version was released. It's not a final version so it could be unstable but it definitely worth trying since there are some features which directly affect working with Yii:

  • Support of the Codeception testing framework.
  • Recognition of PHP class names in strings.
  • Current scope highlighting for alternative syntax.