rgsystemes / uservoice-bundle
Integrate easily UserVoice into your Symfony2 projects
Installs: 4 198
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 2
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=5.3.2
- symfony/framework-bundle: 2.*
- uservoice/uservoice: >=0.0.5
This package is auto-updated.
Last update: 2020-01-16 10:46:20 UTC
README
Easily integrate UserVoice into your Symfony2 projects.
Installation
- Add this bundle to your vendor/ dir using the vendors script:
Add the following to your `composer.json`:
"rgsystemes/uservoice-bundle": "dev-master"
and run:
php composer.phar install
The bundle is compatible with Symfony 2.0 upwards.
-
Add this bundle to your application's kernel:
// app/AppKernel.php public function registerBundles() { return array( // ... new RG\UserVoiceBundle\RGUserVoiceBundle(), // ... ); }
-
Configure the
rg_user_voice
service in your config.yml:rg_user_voice: domain: %uservoice_domain% sso_key: %uservoice_sso_key% widget_key: %uservoice_widget_key% primary_color: %uservoice_primary_color% link_color: %uservoice_link_color% forum_id: %uservoice_forum_id%
That's it for basic configuration.
Usage
In your template, you can include the widget:
{% include "UserVoiceBundle::widget.html.twig" %}
In your controllers:
$userVoiceOptions = $this->container->get('rg_uservoice_options');
$userVoiceOptions["disabled"] = !$this->getUser()->getAccount()->isUserVoiceEnabled();
Available UserVoice options:
- disabled: true (default: false)
It is also possible to generate your SSO token from a Twig template:
<a href="http://domain.uservoice.com/knowledgebase?sso={{ rg_uservoice_sso(app.user.name) }}">
Overriding the template
You can override the template used by copying the
Resources/views/widget.html.twig
file out of the bundle and placing it
into app/Resources/RGUserVoiceBundle/views
, then customising
as you see fit.