seosa / feedback-bundle
This Bundle provides feedback functionality for Symfony2 applications
Installs: 236
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 1
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=5.4
- doctrine/doctrine-bundle: ~1.1
- doctrine/orm: >=2.3
- friendsofsymfony/rest-bundle: ~1.2
- jms/serializer-bundle: ~0.13
- symfony/expression-language: >=2.3
- symfony/form: >=2.3
- symfony/framework-bundle: >=2.3
- symfony/security-bundle: >=2.3
- symfony/twig-bundle: >=2.3
- symfony/validator: >=2.3
- symfony/yaml: >=2.3
Requires (Dev)
- sonata-project/admin-bundle: dev-master
Suggests
- sonata-project/admin-bundle: Allows for SonataAdmin integration.
This package is not auto-updated.
Last update: 2017-09-26 10:37:40 UTC
README
Features:
- Provides feedback interface
Installation:
Step 1: Download SeoSAFeedbackBundle using composer
Add SeoSAFeedbackBundle in your composer.json:
{ "require": { "seosa/feedback-bundle": "dev-master" } }
Now tell composer to download the bundle by running the command:
$ php composer.phar update seosa/feedback-bundle
Composer will install the bundle to your project's seosa/feedback-bundle
directory.
Step 2: Enable the bundle
Enable the bundle in the kernel:
<?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new FOS\RestBundle\FOSRestBundle(), new JMS\SerializerBundle\JMSSerializerBundle($this), new SeoSA\FeedbackBundle\SeoSAFeedbackBundle(), // ... ); }
Step 3: Create you own message class
Anonymous
// src/Acme/FeedbackBundle/Entity/FeedbackMessage.php namespace Acme\FeedbackBundle\Entity; ** * Class Acme\FeedbackBundle\Entity\FeedbackMessage * * @ORM\Entity */ class FeedbackMessage extends Message { }
Or signed
// src/Acme/FeedbackBundle/Entity/FeedbackMessage.php namespace Acme\FeedbackBundle\Entity; use Symfony\Component\Security\Core\User\UserInterface; ** * Class Acme\FeedbackBundle\Entity\FeedbackMessage * * @ORM\Entity */ class FeedbackMessage extends Message implements SignedMessageInterface { /** * @var User * @ORM\ManyToOne(targetEntity="Acme\FeedbackBundle\EntityUser", cascade={"remove"}) */ protected $author; /** * @param UserInterface|null $user * * @return $this */ public function setAuthor(UserInterface $user = null) { $this->author = $user; return $this; } /** * @return UserInterface|null */ public function getAuthor() { return $this->author; } }
Step 4: Import SeoSAFeedbackBundle routing
In YAML somthing like:
# app/config/routing.yml seo_sa_feedback: type: rest resource: @SeoSAFeedbackBundle/Resources/config/routing.yml prefix: /feedback defaults: {_format: 'html'}
Step 5: Add minimal configuration
# app/config/config.yml seo_sa_feedback: message: class: Acme\FeedbackBundle\Entity\FeedbackMessage
Step 6: Add bundle into assetic
# app/config/config.yml assetic: .... bundles: ['SeoSAFeedbackBundle']
Step final: Add button or panel into your template
{# Add a button #} {% include 'SeoSAFeedbackBundle:Feedback:button.html.twig' %}
{# Add a panel #} {% include 'SeoSAFeedbackBundle:Feedback:panel.html.twig' %}
Optional:
Override templates
# app/config/config.yml seo_sa_feedback: .... templating: layout: 'AcmeFeedbackBundle::feedback-layout.html.twig' message_show: 'AcmeFeedbackBundle:FeedbackMessage:show.html.twig' message_form: 'AcmeFeedbackBundle:FeedbackMessage:form.html.twig' message_list: 'AcmeFeedbackBundle:FeedbackMessage:list.html.twig'
Enable SonataAdminIntegration
# app/config/config.yml seo_sa_feedback: .... sonata_admin: enabled: true group: YouSonataAdminGroup label: YouSonataAdminTitle