2017 © Pedro Peláez
 

symfony-bundle star-rating-bundle

Star Rating Bundle for use with Symfony 4 using Font Awesome. This bundle adds the 'rating' form type and rating filter to render ratings. Simple and easy to use.

image

brokoskokoli/star-rating-bundle

Star Rating Bundle for use with Symfony 4 using Font Awesome. This bundle adds the 'rating' form type and rating filter to render ratings. Simple and easy to use.

  • Sunday, June 17, 2018
  • by brokoskokoli
  • Repository
  • 1 Watchers
  • 1 Stars
  • 14 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 19 Forks
  • 0 Open issues
  • 15 Versions
  • 0 % Grown

The README.md

StarRatingBundle

This is a fork of the blackknight467 StarRatingBundle and support symfony 4!, (*1)

Old Readme

Star Rating Bundle for Symfony 3. Requires Jquery and Font Awesome., (*2)

If Using Symfony 2. Use version 1.*, (*3)

Sample Output

alt tag, (*4)

Installation

Step 1: Download the StarRatingBundle

Using Composer, (*5)

Add the following to the "require" section of your composer.json file:, (*6)

    "blackknight467/star-rating-bundle": "2.*"

Step 2: Enable the bundle

Enable the bundle in the kernel:, (*7)

<?php
// app/appKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new blackknight467\StarRatingBundle\StarRatingBundle(),
    );
}

Add the config for TWIG:, (*8)

twig:
    paths:
        '%kernel.project_dir%/vendor/brokoskokoli/star-rating-bundle/Resources/views': BrokoskokoliStarRatingBundle

Step 3: Add the css

Add the css in your page head, (*9)

  <link rel="stylesheet" type="text/css" href="{{ asset('bundles/starrating/css/rating.css') }}" />

or, (*10)

    {% stylesheets
      'bundles/starrating/css/rating.css'
      filter="cssrewrite" %}
      <link href="{{ asset_url }}" rel="stylesheet" type="text/css" />
    {% endstylesheets %}

Step 4: Add the js

Add the javascript to your page head, (*11)

    <!-- make sure that jquery is included --!>
    <script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
    <script src="{{ asset('bundles/starrating/js/rating.js') }}"></script>

or, (*12)

    <!-- make sure that jquery is included --!>
    <script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
    {% javascripts
      '@StarRatingBundle/Resources/public/js/rating.js' %}
      <script src="{{ asset_url }}"></script>
    {% endjavascripts %}

Usage

In a Form

<?php
    // ...
    $builder->add('rating', RatingType::class, [
        'label' => 'Rating'
    ]);
    // ...

or for a custom rating scale:, (*13)

<?php
    // ...
    $builder->add('rating', RatingType::class, [
        //...
        'stars' => 4,
        //...
    ]);
    // ...

Display in a twig template using the rating filter

    // ...
    {{ someInteger|rating }}
    // ...

or if you are not using a 5 star scale, (*14)

{{ someInteger|rating(4) }}

if you want to use the font awesome icon sizes, (*15)

{{ someInteger|rating(5, "fa-3x") }}

If you want the smallest size use "fa-norm" (in font awesome, this would be the same as not providing an size class); providing no size argument sets the font size to 25px which is somewhere in between "fa-lg" and "fa-2x". To customize the size, feel free to override the css., (*16)

License

This bundle is under the MIT license. See the complete license in the bundle: LICENSE, (*17)

The Versions

17/06 2018

dev-master

9999999-dev http://github.com/brokoskokoli/StarRatingBundle

Star Rating Bundle for use with Symfony 4 using Font Awesome. This bundle adds the 'rating' form type and rating filter to render ratings. Simple and easy to use.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Derick Felsman
by Steven Ng
by Avatar brokoskokoli

bundle symfony rating star symfony4

17/06 2018

v3.0.6

3.0.6.0 http://github.com/brokoskokoli/StarRatingBundle

Star Rating Bundle for use with Symfony 4 using Font Awesome. This bundle adds the 'rating' form type and rating filter to render ratings. Simple and easy to use.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Derick Felsman
by Steven Ng
by Avatar brokoskokoli

bundle symfony rating star symfony4

17/06 2018

v3.0.5

3.0.5.0 http://github.com/brokoskokoli/StarRatingBundle

Star Rating Bundle for use with Symfony 4 using Font Awesome. This bundle adds the 'rating' form type and rating filter to render ratings. Simple and easy to use.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Derick Felsman
by Steven Ng
by Avatar brokoskokoli

bundle symfony rating star symfony4

17/06 2018

v3.0.4

3.0.4.0 http://github.com/brokoskokoli/StarRatingBundle

Star Rating Bundle for use with Symfony 4 using Font Awesome. This bundle adds the 'rating' form type and rating filter to render ratings. Simple and easy to use.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Derick Felsman
by Steven Ng
by Avatar brokoskokoli

bundle symfony rating star symfony4

17/06 2018

v3.0.3

3.0.3.0 http://github.com/brokoskokoli/StarRatingBundle

Star Rating Bundle for use with Symfony 4 using Font Awesome. This bundle adds the 'rating' form type and rating filter to render ratings. Simple and easy to use.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

by Derick Felsman
by Steven Ng
by Avatar brokoskokoli

bundle symfony rating star symfony4

17/06 2018

v3.0.2

3.0.2.0 http://github.com/brokoskokoli/StarRatingBundle

Star Rating Bundle for use with Symfony 4 using Font Awesome. This bundle adds the 'rating' form type and rating filter to render ratings. Simple and easy to use.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

by Derick Felsman
by Steven Ng
by Avatar brokoskokoli

bundle symfony rating star symfony4

17/06 2018

v3.0.1

3.0.1.0 http://github.com/brokoskokoli/StarRatingBundle

Star Rating Bundle for use with Symfony 4 using Font Awesome. This bundle adds the 'rating' form type and rating filter to render ratings. Simple and easy to use.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

by Derick Felsman
by Steven Ng
by Avatar brokoskokoli

symfony2 bundle symfony rating star

17/06 2018

v3.0.0

3.0.0.0 http://github.com/brokoskokoli/StarRatingBundle

Star Rating Bundle for use with Symfony 4 using Font Awesome. This bundle adds the 'rating' form type and rating filter to render ratings. Simple and easy to use.

  Sources   Download

MIT

The Requires

  • php >=7.1

 

The Development Requires

by Derick Felsman
by Steven Ng
by Avatar brokoskokoli

symfony2 bundle symfony rating star

12/04 2016

v2.0.1

2.0.1.0 http://github.com/blackknight467/StarRatingBundle

Star Rating Bundle for use with Symfony 2 using Font Awesome. This bundle adds the 'rating' form type and rating filter to render ratings. Simple and easy to use.

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

by Derick Felsman
by Steven Ng

symfony2 bundle symfony rating star

06/04 2016

v2.0

2.0.0.0 http://github.com/blackknight467/StarRatingBundle

Star Rating Bundle for use with Symfony 2 using Font Awesome. This bundle adds the 'rating' form type and rating filter to render ratings. Simple and easy to use.

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

by Derick Felsman
by Steven Ng

symfony2 bundle symfony rating star

16/02 2016

v1.0.3

1.0.3.0 http://github.com/blackknight467/StarRatingBundle

Star Rating Bundle for use with Symfony 2 using Font Awesome. This bundle adds the 'rating' form type and rating filter to render ratings. Simple and easy to use.

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

by Derick Felsman
by Steven Ng

symfony2 bundle symfony rating star

06/04 2015

v1.0.2

1.0.2.0 http://github.com/blackknight467/StarRatingBundle

Star Rating Bundle for use with Symfony 2 using Font Awesome. This bundle adds the 'rating' form type and rating filter to render ratings. Simple and easy to use.

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

by Derick Felsman
by Steven Ng

symfony2 bundle symfony rating star

03/01 2015

v1.0.1

1.0.1.0 http://github.com/blackknight467/StarRatingBundle

Star Rating Bundle for use with Symfony 2 using Font Awesome. This bundle adds the 'rating' form type and rating filter to render ratings. Simple and easy to use.

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

by Derick Felsman
by Steven Ng

symfony2 bundle symfony rating star

28/12 2014

v1.0

1.0.0.0 http://github.com/blackknight467/StarRatingBundle

Star Rating Bundle for use with Symfony 2 using Font Awesome. This bundle adds the 'rating' form type and rating filter to render ratings. Simple and easy to use.

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

by Derick Felsman
by Steven Ng

symfony2 bundle symfony rating star

28/12 2014

v0.5

0.5.0.0 http://github.com/blackknight467/StarRatingBundle

Star Rating Bundle for use with Symfony 2 using Font Awesome. This bundle adds the 'rating' form type and rating filter to render ratings. Simple and easy to use.

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

by Derick Felsman
by Steven Ng

symfony2 bundle symfony rating star