PHPackages                             wbf/mvc - 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. wbf/mvc

ActiveLibrary

wbf/mvc
=======

An helper component for MVC in Wordpress

010PHP

Since May 25Pushed 8y ago3 watchersCompare

[ Source](https://github.com/wagaweb/wbf_mvc)[ Packagist](https://packagist.org/packages/wbf/mvc)[ RSS](/packages/wbf-mvc/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

MVC
===

[](#mvc)

MVC paradigm for Wordpress templates.

This component provide the ability to effectively split code from templates in Wordpress.

Usage of HTMLView
-----------------

[](#usage-of-htmlview)

HTMLView is the default view type provided by component. You can use is to display HTML templates.

- Create a new instance of HTMLView:

```
$v = new \WBF\components\mvc\HTMLView("path/to/template.php");
```

- Assign some vars to the template and display it

```
$vars = [
    'title' => "Hello World"
];
$v->display();
```

- In template.php you can:

```

```

The View has some really interesting features:

- You can provide a path relative to the current theme or relative to a plugin. The template file will be enqueued in a template hierarchy array, so you can override the template file by placing a new template with the same name/path in a child theme. If the path is relative to a plugin, any similiar template found in child theme or in parent theme will override the original template. ```
    //If you are in a twentysixteen child called "foobar"...
    $v = new \WBF\components\mvc\HTMLView("path/to/template.php");
    /* Will looking for (in order):
    /wp-content/themes/foobar/path/to/template.php
    /wp-content/themes/twentysixteen/path/to/template.php
    */
    ```
- You can easily cache the $vars array to boost performances. The same task can be tedious with a simple `require`.
- You can easily implement some other templating systems by extending View.

### Use dashboard page wrapper

[](#use-dashboard-page-wrapper)

```
$v = new \WBF\components\mvc\HTMLView("path/to/template.php");
$v->for_dashboars()->display([
    'page_title' => "My awesome title",
    'my_name' => "Maya"
]);
```

With template.php:

```
Hello !
```

Will display:

```

    My awesome title
    Hello Maya!

```

### Use custom page wrapper

[](#use-custom-page-wrapper)

```
$v = new \WBF\components\mvc\HTMLView("path/to/template.php");
$v->display([
    'page_title' => "My awesome title",
    'wrapper_class' => "my_wrap",
    'wrapper_el' => "section"
    'title_wrapper' => "%s"
    'my_name' => "Maya"
]);
```

With template.php:

```
Hello !
```

Will display:

```

    My awesome title
    Hello Maya!

```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/ecab5a59cfdd434af4feb082bcb4c24e264ea99574713c876789c3ea8a088c65?d=identicon)[Waga Dev](/maintainers/Waga%20Dev)

---

Top Contributors

[![LostCore](https://avatars.githubusercontent.com/u/2674299?v=4)](https://github.com/LostCore "LostCore (19 commits)")

### Embed Badge

![Health badge](/badges/wbf-mvc/health.svg)

```
[![Health](https://phpackages.com/badges/wbf-mvc/health.svg)](https://phpackages.com/packages/wbf-mvc)
```

PHPackages © 2026

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