2017 © Pedro Peláez
 

symfony-bundle tips-manager-bundle

Simple bundle to show tips

image

tamago/tips-manager-bundle

Simple bundle to show tips

  • Thursday, May 5, 2016
  • by nurikabe
  • Repository
  • 3 Watchers
  • 1 Stars
  • 5,003 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 5 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Overview

Build Status SensioLabsInsight, (*1)

This Symfony bundle allows to integrate a Tip Manager in your Symfony application. The Tip Manager shows you tips relevant to your application. The tips can be seen in different languages., (*2)

The idea is to: * write tips and their translations in files (yml) for at least one language (the default language of your website for example). * load tips and their translations into the database by using command line. * freely edit/add translation through an edition page., (*3)

You can also provide feedback for a tip through like/dislike buttons. The feedback and other details related to the tips can be viewed on a stats page., (*4)

Here is a screenshot of what an example tip looks like:, (*5)

tip screenshot, (*6)

Installation

Add the bundle to your composer.json file:, (*7)

require: {
    // ...
    "tamago/tips-manager-bundle": "dev-master"
}

Or install directly through composer with:, (*8)

# Latest stable
composer require tamago/tips-manager-bundle dev-master

Then run a composer update:, (*9)

composer update
# OR
composer update tamago/tips-manager-bundle # to only update the bundle

TamagoTipManagerBundle also installs LexikTranslationManagerBundle which it uses as the mechanism for storing and editing translated tips. Make sure both bundles are registered with your kernel:, (*10)

// in AppKernel::registerBundles()

$bundles = array(
    // ...
    new Tamago\TipsManagerBundle\TamagoTipsManagerBundle(),
    new Lexik\Bundle\TranslationBundle\LexikTranslationBundle(), //if you don't have this installed already
    // ...
);

Integration

:warning: Although LexikTranslationManagerBundle supports Doctrine storage types, TamagoTipManagerBundle currently only formally supports Doctrine ORM., (*11)

Creating the database schema

php app/console doctrine:database:create
php app/console doctrine:schema:update

Render in the pages where you want the tips to show up

{{ render(controller('TamagoTipsManagerBundle:TipsManager:index', {'domain': 'some-domain-name', 'identifier': 'my-identifier'})) }}

The values of 'domain' and 'identifier' attributes in above should respectively be the custom names of the domain and identifier which the tips belong to. You can split tips into multiple categories/domains., (*12)

Configuration

Minimum Configuration

You can skip this step if you are already using LexikTranslationBundle., (*13)

You must at least define a fallback locale(s)., (*14)

lexik_translation:
    fallback_locale: [<locale>] 
    managed_locales: [ <locale1>, <local2>, ... ]
    storage:
        type: orm
        object_manager: <entity/object manager name>

Import translations

To import translations files content into your database, place tip translation YAML files somewhere in your project and import from the directory. For example:, (*15)

php app/console lexik:translations:import -p app/Resources/translations/tips/

See tips-example.en.yml for an example of a simple translation file., (*16)

Routing

To use the tamago based admin pages, add this to routing file of your application:, (*17)

# app/config/routing.yml
tip_bundle_homepage:
    resource: "@TamagoTipsManagerBundle/Resources/config/routing.yml"
    prefix:   /_tips

The stats page will be available here:, (*18)

  • /_tips/stats

A screenshot of the stats page: stats page screen, (*19)


The page to edit/add tips will be available here:, (*20)

  • /_tips/editor

A screenshot of the edition page: edition page screen, (*21)


The Versions

05/05 2016

dev-master

9999999-dev http://www.tamago-db.com/

Simple bundle to show tips

  Sources   Download

MIT

The Requires

 

bundle symfony tips

03/05 2016

dev-tip-stack

dev-tip-stack http://www.tamago-db.com/

Simple bundle to show tips

  Sources   Download

proprietary

The Requires

 

bundle symfony tips