Skip to content

harmstyler/twig-extensions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Twig Extensions

A work in progress set of Twig Extensions

Installation

These Twig Extensions are registered at packagist as harmstyler/twig-extensions and can be easily installed using composer. Alternatively you can simply download the .zip and copy the file from the 'src' folder.

The extensions are designed to be used with Symfony

services:
  twig.extension.date:
    class: HarmsTyler\Twig\LinkToExtension
    tags:
      - { name: twig.extension }

LinkTo Extension

Extension will build out a link, requires link copy and path name to work. Optional html options can be sent in an array.

{{ link_to($link_copy, { 'path_name': { 'id': 1 } }, {'data-method': 'get', 'class': 'my-class'}) }}

will create

<a href="/events/1" data-method="get" class="my-class">Upcoming Event</a>

About

A set of twig extensions

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages