Fork Phpillip on GitHub

Twig utils

Phpillip register some Twig extensions to provide the following filters and functions:

Functions

public: Get the relative or absolute url to a file in the public folder.

Get the relative url to a stylesheet:

<link rel="stylesheet" href="{{ public('css/style.css') }}">

Get the absolute url to an image:

<meta name="twitter:image" content="{{ public('img/twitter.png', true) }}">

Filters

markdown: Parse a mardown string to HTML.

{{ 'My *markdown* sentence'|markdown }}