Skip to content
This repository was archived by the owner on Apr 10, 2022. It is now read-only.

Repository files navigation

Widgets Bundle

Symfony Bundle for easy creating and managing client-side widgets. Has SonataAdminBundle dependency and provide management.

Installation

$ composer.phar require harentius/widgets-bundle
  1. Enable bundle in the kernel:
<?php// app/AppKernel.phppublicfunctionregisterBundles()
{
$bundles = array(
// ...newHarentius\WidgetsBundle\HarentiusWidgetsBundle(),
);
// ...
}
  1. Include configuration:
imports:
....
- { resource: "@HarentiusWidgetsBundle/Resources/config/config.yml" }
  1. Configure:
harentius_widgets:
# List of routes, where widgets can be placedroutes:
acme_homepage:
# User-friendly name for displaying in admin section (sonata)name: Homepageacme_blog_show:
name: Article# Parameters, present in routeparameters:
slug:
# Source (Now only entity supported)source:
class: HarentiusBlogBundle:Article# Value to be passed to the route field: slug# Value to be shown in admin sectionidentity: title# Registering widgets: key used in templates (look behind), value - shown in admin sectionwidgets:
widgets_block_sidebar: Sidebarwidgets_block_bottom_left: Bottom leftwidgets_block_bottom_right: Bottom right
  1. Place in templates where you want:
 {{ harentius_widget('widgets_block_sidebar') }}
....
{{ harentius_widget('widgets_block_bottom_left') }}
....
{{ harentius_widget('widgets_block_bottom_right') }}

About

Symfony Bundle for easy creating and managing client-side widgets

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages