PHPackages                             brtriver/phptalserviceprovider - 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. brtriver/phptalserviceprovider

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

brtriver/phptalserviceprovider
==============================

PHPTAL for Silex

6421[1 issues](https://github.com/brtriver/PHPTALServiceProvider/issues)PHP

Since May 18Pushed 12y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

PHPTALServiceProvider, a part of Silex Framework Providers
==========================================================

[](#phptalserviceprovider-a-part-of-silex-framework-providers)

[PHPTAL](http://phptal.org/manual/en/split/introduction.html) is one of PHP template engines, which is an implementation of the excellent Zope Page Template (ZPT) system for PHP. And [Silex](http://silex.sensiolabs.org/) is a PHP microframework, which is very light and is based on [Symfony2](http://symfony.com). This extension allow you to use PHPTAL as a template engine in Silex.

Instllation
-----------

[](#instllation)

the best way to install this service provider is to use composer. as the first, creating `composer.json` file in your project below:

```
    {
        "require": {
            "brtriver/PHPTALServiceProvider": "dev-master"
        }
    }

```

If you also want to install PHPTAL, just added like below:

```
    {
        "repositories": [
            {
                "type": "package",
                "package": {
                    "name": "pornel/PHPTAL",
                    "version": "1.2.2",
                    "dist": {
                        "url": "http://phptal.org/files/PHPTAL-1.2.2.zip",
                        "type": "zip"
                    },
                    "source": {
                        "url": "https://github.com/pornel/PHPTAL.git",
                        "type": "git",
                        "reference": "Release 1.2.2"
                    }
                }
            }
        ],
        "require": {
            "brtriver/PHPTALServiceProvider": "dev-master",
            "pornel/PHPTAL": "1.2.2"
        }
    }

```

then install composer.php and install

```
$ wget http://getcomposer.org/composer.phar
$ php composer.phar install

```

download PHPTALServiceProvider and set to this directory and finally the path of this is below: ./vendor/brtriver/PHPTALServiceProvider/PHPTALServiceProvider.php

Then PHPTAL library is set to ./vendor/phptal directory and PHPTAL templates is set under views directory.

```
/project_directory
│  ├── .htaccess
│  ├── silex.phar
│  ├── composer.json
│  ├── composer.phar
│  └── index.php
├── vendor
│   ├── bin
│   ├── brtriver
│   │   └── PHPTALServiceProvider
│   │       └─ PHPTALServiceProvider.php
│   └── pornel
│       └── PHPTAL
└── views
    └── teset.html (PHPTAL template files is set here)

```

Sample Code
-----------

[](#sample-code)

in index.php, you require this PHPTALServiceProvider file and register it, then your code is like below:

### index.php

[](#indexphp)

After calling register method, $app\['phptal'\] is a instance of PHPTAL. You can use it as PHPTAL itself. You have to set a template path first.

```

      Place for the page title

    sample title

          Name

            person's name

            sample name

```

License
-------

[](#license)

PHPTALExtension is licensed under the MIT license.

###  Health Score

22

—

LowBetter than 23% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity14

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/a8833660f7d5586520ef2b32f3e91c2a8cd08e260fe02150535a882d8dc6ba14?d=identicon)[brtriver](/maintainers/brtriver)

---

Top Contributors

[![brtriver](https://avatars.githubusercontent.com/u/111285?v=4)](https://github.com/brtriver "brtriver (10 commits)")

### Embed Badge

![Health badge](/badges/brtriver-phptalserviceprovider/health.svg)

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

###  Alternatives

[mustache/mustache

A Mustache implementation in PHP.

3.3k44.6M291](/packages/mustache-mustache)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[whitecube/nova-flexible-content

Flexible Content &amp; Repeater Fields for Laravel Nova.

8053.0M25](/packages/whitecube-nova-flexible-content)[mopa/bootstrap-bundle

Easy integration of twitters bootstrap into symfony2

7042.9M33](/packages/mopa-bootstrap-bundle)[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3871.2M](/packages/limenius-react-bundle)[nicmart/string-template

StringTemplate is a very simple string template engine for php. I've written it to have a thing like sprintf, but with named and nested substutions.

2101.7M30](/packages/nicmart-string-template)

PHPackages © 2026

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