karolnet / twig-rating-filter
Rating filter for twig
Installs: 297
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=5.3.3
Requires (Dev)
- phpunit/phpunit: ~4.8
- twig/twig: ~1.0
README
Description
Karolnet RatingFilter is simple twig filter to generate stars rating from number
Installation
composer require karolnet/rating-filter
add bundle to AppKernel:
new \KarolNet\TwigRatingFilterBundle\KarolNetTwigRatingFilterBundle()
configure if you want:
karol_net_twig_rating_filter:
templates:
default:
red:
star_full_template: '<i class="fa fa-star fa-2xx" style="color: red"></i>'
Usage:
{{ 3 | rating }}. {# default template #}
{{ 4 | rating('red') }} {# red template #}