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

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

lighth7015/phptal-laravel
=========================

PHPTAL for Laravel

03PHP

Since Apr 23Pushed 5y agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

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

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

[](#installation)

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

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

Simply copy the example config to your `config` directory.

```
php ./artisan vendor:publish --provider 'lighth7015\LaravelPHPTAL\ServiceProvider'
```

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:

```
