PHPackages                             marcoshoo/phptal-laravel - 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. marcoshoo/phptal-laravel

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

marcoshoo/phptal-laravel
========================

PHPTAL for Laravel 5.x

13072[1 issues](https://github.com/marcoshoo/phptal-laravel/issues)PHP

Since Feb 7Pushed 10y ago1 watchersCompare

[ Source](https://github.com/marcoshoo/phptal-laravel)[ Packagist](https://packagist.org/packages/marcoshoo/phptal-laravel)[ RSS](/packages/marcoshoo-phptal-laravel/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Allows you to use [PHPTAL](http://www.phptal.org) seamlessly in [Laravel](http://www.laravel.com)

Installation
============

[](#installation)

Add `MarcosHoo\LaravelPHPTAL` as a requirement to composer.json:

```
{
    "require": {
        "phptal/phptal": "dev-master",
        "marcoshoo/phptal-laravel": "dev-master"
    }
}
```

Update your packages with `composer update` or install with `composer install`.

Once Composer has installed or updated your packages you need to register PHPTAL with Laravel. Open up app/config/app.php and find the providers key towards the bottom and add:

```
MarcosHoo\LaravelPHPTAL\PHPTALServiceProvider::class,
```

Next step is copy example config to your `config` directory.

```
php ./artisan vendor:publish --provider 'MarcosHoo\LaravelPHPTAL\PHPTALServiceProvider'
```

Configuration
=============

[](#configuration)

Currently PHPTAL is set by default to HTML5, however, you can change this setting in its config.php file, XHTML, or XML.

Filters
=======

[](#filters)

PHPTAL also has a nice feature which you can use called filters, for example I have one that bust the cache for images, js, css, this is configurable via the config file.

```
'preFilters' => [
    'bustCache',
    'minimizeJs',
    'adderJs'
]
```

\#Usage

You call the PHPTAL template like you would any other view:

```
view('hello', [...])
```

#### Translation

[](#translation)

PHPTALTranslator class uses Laravel translation service, so the translation files should be placed in the same translation files directory of the framework. Examples of how to use the a translation with id 'welcome' contained in a file called 'messages.php':

```

```

```
welcome
```

```

```

```
messages.welcome
```

#### Pluralization

[](#pluralization)

Translation file:

```
