[news] View 1.0.0


First version of View package is released. This library provides templates rendering abstraction supporting layout-view-subview hierarchy, custom renderers with PHP-based as default and more. It is used in Yii Framework 3 but is supposed to be usable separately.
PHP templates look like the following:
<?php

declare(strict_types=1);

/**
* @var Yiisoft\View\View $this
* @var App\Blog\Post[] $posts
*/
?>

Posts:

<?php foreach ($posts as $post): ?>
Title: <?= $post->getTitle() . "\n" ?>
Description: <?= $post->getDescription() . "\n\n"?>
<?php endforeach ?>

The view package is divided into two parts:

  1. General purpose view suitable for any template rendering such as emails, SMS messages etc.
  2. Web-specific views supporting HTML-specific functionality

As usual, the package has 100% tests coverag and close to 100% type coverage and mutation score.