PHPackages                             iluhansk/yii2-renderer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. iluhansk/yii2-renderer

ActiveYii2-extension[Templating &amp; Views](/categories/templating)

iluhansk/yii2-renderer
======================

Provides visualization functionality (rendering templates) to any component of yii2 application

v1.0.0(9y ago)04GPL-3.0+PHP

Since Mar 26Pushed 9y ago1 watchersCompare

[ Source](https://github.com/iluhansk/yii2-renderer)[ Packagist](https://packagist.org/packages/iluhansk/yii2-renderer)[ RSS](/packages/iluhansk-yii2-renderer/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Yii2 renderer
=============

[](#yii2-renderer)

Provides visualization functionality (rendering views) to any component of yii2 application

- simple sintax
- view is searched by classes inheritance

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist iluhansk/yii2-renderer "*"

```

or add

```
"iluhansk/yii2-renderer": "*"

```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

Add RenderBehavior to target class:

```
namespace common\components;

use \yii\base\Component;
use iluhansk\renderer\RenderBehavior;

class Car extends Component {

    public function behaviors() {
        return [
            'renderer' => [
                'class' => RenderBehavior::className(),
                'baseClass' => __CLASS__,
                'baseViewDir' => '@frontend/views/car',
                'defaultView' => 'model',
                'viewNotFound' => '-',
            ]
        ];
    }

}
```

And use rendering in an place:

```
use common\components\Car;

$car = new Car();
echo $car->render(); //render default view (in this example it is "model")
echo $car->render('options',['data'=>'passed','to'=>'view']); //render view "options"
```

Inside view you can access to object by var $context

Example of view search process:
-------------------------------

[](#example-of-view-search-process)

continue of example above:

```
class Sedan extends Car {
...
}
class Econom extends Sedan {
...
}

$car = new Econom();
echo $car->render('options');
//First, a view "options" will be search at @frontend/views/car/sedan/econom directory
//If it is not found, then it will be search at @frontend/views/car/sedan directory
//If it is not found, then it will be search at @frontend/views/car (it from behavior field baseViewDir)
//If it is not found, then it will return viewNotFound text (in this example it is '-')
```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3383d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/13678362?v=4)[iluhansk](/maintainers/iluhansk)[@iluhansk](https://github.com/iluhansk)

---

Top Contributors

[![iluhansk](https://avatars.githubusercontent.com/u/13678362?v=4)](https://github.com/iluhansk "iluhansk (2 commits)")

---

Tags

templateviewyii2extensionrenderRendering

### Embed Badge

![Health badge](/badges/iluhansk-yii2-renderer/health.svg)

```
[![Health](https://phpackages.com/badges/iluhansk-yii2-renderer/health.svg)](https://phpackages.com/packages/iluhansk-yii2-renderer)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M2.9k](/packages/craftcms-cms)[marekpetras/yii2-calendarview-widget

CalendarView widget for Yii 2 Framework.

2229.6k](/packages/marekpetras-yii2-calendarview-widget)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
