https://github.com/harmstyler/twig-extensions
A set of twig extensions
https://github.com/harmstyler/twig-extensions
Last synced: 18 days ago
JSON representation
A set of twig extensions
- Host: GitHub
- URL: https://github.com/harmstyler/twig-extensions
- Owner: harmstyler
- License: mit
- Created: 2014-05-30T21:20:03.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2014-05-30T21:40:19.000Z (about 11 years ago)
- Last Synced: 2025-02-18T00:39:48.952Z (4 months ago)
- Language: PHP
- Size: 137 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
```yml
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.
```twig
{{ link_to($link_copy, { 'path_name': { 'id': 1 } }, {'data-method': 'get', 'class': 'my-class'}) }}
```
will create
```html
Upcoming Event
```