PHPackages                             liubinas/upvote-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. liubinas/upvote-bundle

ActiveSymfony-bundle

liubinas/upvote-bundle
======================

Upvote and downvote (aka thumbs up) bundle for Symfony project

0.1.1(8y ago)3161MITPHP

Since May 7Pushed 8y agoCompare

[ Source](https://github.com/tomasliubinas/LtUpvoteBundle)[ Packagist](https://packagist.org/packages/liubinas/upvote-bundle)[ RSS](/packages/liubinas-upvote-bundle/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (10)Versions (3)Used By (0)

LtUpvoteBundle
==============

[](#ltupvotebundle)

LtUpvoteBundle is upvote and downvote (thumbs up and thumbs down) component for Symfony 3.0 project

Features
--------

[](#features)

- Configurable vote permissions
- Automatically limit unauthenticated upvotes/downvotes by IP
- Optionally hide upvote/downvote button
- Pure JavaScript frontend component implementation
- Unit tested

System requirements
-------------------

[](#system-requirements)

- Symfony 3.0
- Doctrine bundle with configured database connection

Installation
------------

[](#installation)

- Require LtUpvoteBundle over composer in your existing Symfony project:

```
composer require liubinas/upvote-bundle

```

- Initialize it in the app/AppKernel.php file:

```
$bundles[] = new Lt\UpvoteBundle\LtUpvoteBundle();
```

- Import LtUpvoteBundle routing:

```
# app/config/routing.yml
lt-upvote:
    resource: "@LtUpvoteBundle/Resources/config/routing.xml"
```

- Create required database tables:

```
$ bin/console  doctrine:schema:update

```

Configuration
-------------

[](#configuration)

The following is an example configuration defining basic context types `blog-post` and `comment`:

```
    # app/config/config.yml
    lt-upvote-bundle:
        types:
            blog-post: # Custom context type
                show_upvote: true
                show_downvote: true
                allow_unauthenticated_upvote: true
                allow_unauthenticated_downvote: false
            comment # Custom context type having the default values all true
```

Test run
--------

[](#test-run)

Start web server:

```
$ bin/console server:start

```

Test page could be accessed by navigating to `http:///lt-upvote-test` on your `dev` environment.

Front-end
---------

[](#front-end)

Front-end functionality is implemented in a single dependency free JavaScript file. Styles are defined in CSS file which could be used out of the box or adopted according to custom requirements.

### JavaScript

[](#javascript)

- Include JavaScrip module file (Twig syntax):

```

```

- Initialize JavaScript module in your HTML page:

```

```

### CSS

[](#css)

- Include basic CSS file in your html `` section:

```

```

### Twig

[](#twig)

- Include one or more front end components into your page rendered over Controller

```
{{ render(
    controller(
        'lt_upvote_bundle.controller.default:renderVoteComponent',
        {
            'subjectType': '[TYPE]',
            'subjectId': '[ID]',
            'css_class': '[CLASS]'
        }
    )
) }}

```

Where:

- `[TYPE]` is context type value.
- `[ID]` is Subject ID value.
- `[CLASS]` is component specific styling CSS class. Predefined styles are `Style1`, `Style2`.

See [test.html.twig](Resources/views/Default/test.html.twig) file for example implementation.

### JavaScript Custom Event handling

[](#javascript-custom-event-handling)

On each upvote/downvote action JavaScript event is dispatched. This action could be handled by adding custom event listener for `ltu` event type.

An example code for unauthenticated downvote handling:

```
addEventListener('ltu', function(event) {
    if (event.detail.unauthenticatedError) {
        alert('This action is permitted for the logged in visitors only.');
    }
})
```

The following properties describing performed action could be accessed from `even.detail` data object: `id`, `type`, `counter`, `action`, `unauthentificated`, `unauthentificatedError`.

License
-------

[](#license)

This bundle is under the MIT license. See the complete license in [LICENSE](LICENSE) file. f

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

2926d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f86b93ddf8a881b56fd6ba43ebc413bb77c208dbeb53f467851ac24112accc11?d=identicon)[tomasliubinas](/maintainers/tomasliubinas)

---

Top Contributors

[![tomasliubinas](https://avatars.githubusercontent.com/u/1522729?v=4)](https://github.com/tomasliubinas "tomasliubinas (197 commits)")

---

Tags

bundlesymfonythumbsupupvote

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/liubinas-upvote-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/liubinas-upvote-bundle/health.svg)](https://phpackages.com/packages/liubinas-upvote-bundle)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

7310.3k29](/packages/open-dxp-opendxp)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
