PHPackages                             antonienko/php-template-previewer - 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. [Framework](/categories/framework)
4. /
5. antonienko/php-template-previewer

ActiveLibrary[Framework](/categories/framework)

antonienko/php-template-previewer
=================================

For designers testing their framework views without the working backend code.

v0.2.0(11y ago)12.6kMITPHPPHP &gt;=5.4

Since Apr 29Pushed 10y ago1 watchersCompare

[ Source](https://github.com/antonienko/php-template-previewer)[ Packagist](https://packagist.org/packages/antonienko/php-template-previewer)[ RSS](/packages/antonienko-php-template-previewer/feed)WikiDiscussions master Synced 1mo ago

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

PHP Template Previewer
======================

[](#php-template-previewer)

[![Build Status](https://camo.githubusercontent.com/0d88784e5d7113ce8e696ffc1c46736cef7d5072f8b06e6caae97fcd268d426f/68747470733a2f2f6170692e736869707061626c652e636f6d2f70726f6a656374732f3535336639336538656464376632633035326435613061392f62616467653f6272616e63684e616d653d6d6173746572)](https://app.shippable.com/projects/553f93e8edd7f2c052d5a0a9/builds/latest)

**PHP template previewer** for designers testing their framework views without the working backend code.

Originally created for a personal project using the Phalcon PHP framework and its templating system Volt.

\####Disclaimer: This is my first composer as well as open source project, so if you see anything that needs improving, don't hesitate and tell me. Read my [introduction post](http://www.antoniohs.com/2015/04/29/php-template-previewer-improving-the-workflow-between-web-designers-and-coders/)

\##List of implemented frameworks

- Phalcon

\###Extending the framework support You can make a request for any framework that you want to use this library into, or even better, make a **pull request with your own framework strategy**. Just implement the [IFrameworkStrategy interface](lib/antonienko/PhpTempPrev/FrameworkStrategies/IFrameworkStrategy.php). Use the files under the [FrameworkStrategies folder](lib/antonienko/PhpTempPrev/FrameworkStrategies) as an example.

\##What's new

### v0.2.0

[](#v020)

- Added Json file support for the variable files

\##Installation ###Composer This library is available in packagist.org, you can add it to your project via Composer.

In the "require" section of your composer.json file:

Always up to date (bleeding edge, API *not* guaranteed stable)

```
"antonienko/php-template-previewer": "dev-master"
```

Specific minor version, API stability

```
"antonienko/php-template-previewer": "0.2.*"
```

If you have any problems with the *minimum-stability* setting try appending @dev to the version

```
"antonienko/php-template-previewer": "0.2.*@dev"
```

\##Sample Usage

### Phalcon Framework

[](#phalcon-framework)

*DesignController* with an action *View* that gets two parameters: `$controller` and `$view`, which are the name of the controller and action view that you want to render. You would call the url like this: `http://localhost/designTest/view/controllername/viewname` but you are not restricted to use it in this way

```
namespace app\controllers;
use antonienko\PhpTempPrev\FrameworkStrategies\PhalconStrategy;
use antonienko\PhpTempPrev\FileStrategies\IniFileStrategy;
use antonienko\PhpTempPrev\Previewer;

class DesignTestController extends ControllerBase
{
    public function viewAction($controller, $view)
    {
        $view_variables_file = APP_PATH . 'templateHelpers/' . $controller . '/' . $view . '.ini';
        $layout_variables_file = APP_PATH . 'templateHelpers/general.ini';
        $previewer = new Previewer(new PhalconStrategy($this->view));
        $previewer->render("$controller/$view", new IniFileStrategy([$layout_variables_file, $view_variables_file]));
    }
}
```

### Var files

[](#var-files)

You pass to the render a class implementing `IFileStrategy` initialized with an array of *var files*. In case of having the same variable defined in two of the *var files*, the last one will prevail.

The variables are separated in three categories: *scalars*, *arrays* and *objects*.

If you want to get an idea of how the *var files* work [take a look at the test fixtures](tests/antonienko/tests/fixtures).

\##License Information Lincensed under **The MIT License (MIT)**. See the LICENSE file for more details.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

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 ~0 days

Total

2

Last Release

4037d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0fcdc6571b70b8819f1b8b419f4acf0e4117942d456414e85dfe574917ab3ac4?d=identicon)[antonienko](/maintainers/antonienko)

---

Tags

frameworktemplatepreview

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/antonienko-php-template-previewer/health.svg)

```
[![Health](https://phpackages.com/badges/antonienko-php-template-previewer/health.svg)](https://phpackages.com/packages/antonienko-php-template-previewer)
```

###  Alternatives

[slim/twig-view

Slim Framework 4 view helper built on top of the Twig 3 templating component

3708.0M210](/packages/slim-twig-view)[slim/php-view

Render PHP view scripts into a PSR-7 Response object.

2739.7M95](/packages/slim-php-view)[rubellum/slim-blade-view

Slim Framework 3 view helper built on the Blade component

1822.4k2](/packages/rubellum-slim-blade-view)

PHPackages © 2026

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