Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jswhetstone/twig-extension
https://github.com/jswhetstone/twig-extension
Last synced: 21 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/jswhetstone/twig-extension
- Owner: jswhetstone
- Created: 2014-06-18T12:57:53.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2014-06-18T19:02:46.000Z (almost 10 years ago)
- Last Synced: 2024-03-15T00:54:49.210Z (3 months ago)
- Language: PHP
- Size: 148 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Lists
- awesome-twig - Useful HTML Extension - Some useful Twig functions for context-relevant class rendering. (Twig / Extensions)
- awesome-twig - Useful HTML Extension - Some useful Twig functions for context-relevant class rendering. (Twig / Extensions)
README
jswhetstone/twig-extension
==============
Some useful Twig functions for context-relevant class rendering.`{{ getActiveClass('/some/page') }}`
> Will return 'active' (without quotes) if the current URI contains the string specified.
> Good for rendering the active state on Bootstrap nav elements.
> Pass an empty string '' to check for root.`{{ getPageClasses() }}`
> Will return a class-ready string representation of the current URI.
> Each directory in the hierarchy is represented by a separate class.
> The root directory will return 'home' (without quotes).license
-------This code is licensed under [WTFPL](http://wtfpl.net)