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

ActiveLibrary

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

WPify Templates

3.2.2(1y ago)014.1k↑25%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 1mo ago

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 83% of packages

Maintenance41

Moderate activity, may be stable

Popularity25

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity60

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

491d ago

Major Versions

1.1.0 → 2.0.02022-03-30

2.1.0 → 3.0.02022-08-29

### Community

Maintainers

![](https://www.gravatar.com/avatar/b322ef9c319c869892c6dcf05296386fa00fc53516df65e438d1cbb72ec3b7ee?d=identicon)[mejta](/maintainers/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

[sonata-project/entity-audit-bundle

Audit for Doctrine Entities

644989.8k1](/packages/sonata-project-entity-audit-bundle)[abydahana/aksara

Aksara is a CodeIgniter based CRUD Toolkit you can use to build complex applications become shorter, secure and more reliable just in a few lines of code. Serving both CMS or Framework, produce both HEADLESS (RESTful API) or TRADITIONAL (Browser Based), just by writing single controller. Yet it's reusable, scalable and ready to use!

1101.2k](/packages/abydahana-aksara)

PHPackages © 2026

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