PHPackages                             wpify/templates - 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. wpify/templates

ActiveLibrary[Templating &amp; Views](/categories/templating)

wpify/templates
===============

WPify Templates

3.2.2(1y ago)015.2k↓27.1%GPL-2.0-or-laterPHP

Since Sep 8Pushed 1y ago1 watchersCompare

[ Source](https://github.com/wpify/templates)[ Packagist](https://packagist.org/packages/wpify/templates)[ RSS](/packages/wpify-templates/feed)WikiDiscussions master Synced yesterday

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

WPify Template
==============

[](#wpify-template)

Abstraction over WordPress Templates.

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

[](#installation)

`composer require wpify/templates`

Usage
-----

[](#usage)

```
use Wpify\Templates\WordPressTemplates;

// Initialize the templates
$template = new WordPressTemplates(
	array(
		plugin_dir_path( __FILE__ ) . 'templates', // path to template files in plugin
		trailingslashit( get_template_directory() ) . 'my-plugin', // path to template files in current theme
	),
);

// Print the html to frontend
$template->print( 'my-template', 'test', array( 'some-args' => 'test' ) );

// Return the html
$html = $template->render( 'my-template', 'test', array( 'some-args' => 'test' ) );
```

The above examples tries to find the templates in the following locations:

- `/wp-content/themes/current-theme/my-plugin-theme-folder/my-template.test.php`
- `/wp-content/themes/current-theme/my-plugin-theme-folder/my-template.php`
- `/wp-content/plugins/my-plugin/templates/my-template.test.php`
- `/wp-content/plugins/my-plugin/templates/my-template.php`

Twig templates
--------------

[](#twig-templates)

You can also use twig templates for rendering. WordPress global variables and some functions are already registered.

```
use Wpify\Templates\TwigTemplates;

// Initialize the templates
$template = new TwigTemplates(
	array(
		plugin_dir_path( __FILE__ ) . 'templates', // path to template files in plugin
		get_template_directory() . 'my-plugin', // path to template files in current theme
	),
	array(
		'integrate' => true, // Allows twig templates for the current theme
		'debug'     => true, // Enable twig debug
		'functions' => array( // Register custom functions.
			'test_function' => function() {
				echo 'TEST';
			},
		),
		'filters' => array( // Register custom filters.
			'test_filter' => function( $value ) {
				echo 'TEST:' . $value;
			},
		),
		'globals' => array( // Register global variables.
			'global_variable' => 'some value',
		),
		'namespaces' => array(
			'blocks' => get_template_directory() . '/blocks',
		),
	)
);

// Print the html to frontend
$template->print( 'my-template', 'test', array( 'some-args' => 'test' ) );

// Return the html
$html = $template->render( 'my-template', 'test', array( 'some-args' => 'test' ) );
```

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 65.5% 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

Every ~55 days

Recently: every ~83 days

Total

23

Last Release

536d ago

Major Versions

1.1.0 → 2.0.02022-03-30

2.1.0 → 3.0.02022-08-29

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/498441?v=4)[Daniel Mejta](/maintainers/mejta)[@mejta](https://github.com/mejta)

![](https://www.gravatar.com/avatar/92d6ba0cde4324b12697fe98421d2430b68bff0a981225d42b103fb53dea16f5?d=identicon)[vasikgreif](/maintainers/vasikgreif)

---

Top Contributors

[![mejta](https://avatars.githubusercontent.com/u/498441?v=4)](https://github.com/mejta "mejta (19 commits)")[![vaclavgreif](https://avatars.githubusercontent.com/u/1177553?v=4)](https://github.com/vaclavgreif "vaclavgreif (10 commits)")

### Embed Badge

![Health badge](/badges/wpify-templates/health.svg)

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

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[symfony/ux-live-component

Live components for Symfony

1647.0M127](/packages/symfony-ux-live-component)[mati365/ckeditor5-symfony

CKEditor 5 integration for Symfony

262.6k](/packages/mati365-ckeditor5-symfony)

PHPackages © 2026

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