Pull to refresh

Yii news 2020, issue 5

Reading time4 min
Views1.8K

Hello, community!


It is time for another Yii news issue. Both Yii 2 and Yii 3 are doing well.


I've finally updated the team page on the website to reflect the current state of things.


Konstantin Sirotkin is back and actively taking care of ElasticSearch Yii 2 extension.


Yii 3 main team was formed (actually happened late 2019). Likely you know the names because most were mentioned in previous Yii news issues.


Also, we have partially moved to GitHub actions. Experience is great so far, so we can definitely recommend that. We're adding phan static analysis
and running tests with Infection to make code quality even better.


I've spent some time on YiiPowered, a place to collect Yii-powered projects that has 571 projects listed so far. Enhancements are:


  • Ability to add projects made with Yii 3.0.
  • Images are automatically fetched from the real website every night for published projects with missing images.

Last time I have mentioned PHP Russia Online conference.
It went well and videos are already available.


As an experiment, I've recorded a video of me working on code reviews. I'd really like to know your opinion on it. Is it worth doing something like these more?
Do you want to know any part of the Yii development process or internals?


Yii 2


Version 2.0.36 was released. It is an important release because of dependency injection container enhancements. It is now closer in features to the one in Yii 3.


In both web controller actions and console controller actions, the following now is possible:


namespace app\controllers;

use yii\web\Controller;
use app\components\BookingInterface;

class HotelController extends Controller
{    
    public function actionBook($id, BookingInterface $bookingService)
    {
        $result = $bookingService->book($id);
        // ...    
    }
}

Another enhancement is that references are now resolved in arrays:


return [
    ContentTypeMiddleware::class => [
        '__construct()' => [
            Instance::of(StreamFactory::class),
            [
                'json' => Intance::of(JsonFormatter::class),
                'yaml' => Intance::of(YamlFormatter::class),
            ],
        ],
    ],
];

Additionally, the following extension releases were made:



Yii 3


First, the application template was implemented. You can start exploring Yii 3 with it. It is not final but should give you a good overview of Yii 3. Suggestions are very welcome.






A bigger picture is available in a Trello board.


New and adjusted internal guidelines:



New and adjusted guide pages:



Reading recommendations



️ Thank you!


I'd like to thank all backers and contributors making Yii 3 possible. We are moving it forward together.


Special thanks for Yii 3 code contributions goes to:


Tags:
Hubs:
If this publication inspired you and you want to support the author, do not hesitate to click on the button
+3
Comments0

Articles

Change theme settings