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

v2 2015-10-19 20:15 UTC

This package is auto-updated.

Last update: 2024-10-29 04:14:41 UTC


README

Build Status

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 #}