2017 © Pedro PelĂĄez
 

symfony-bundle content-bundle

Bigfoot Content bundle

image

bigfoot/content-bundle

Bigfoot Content bundle

  • Friday, May 25, 2018
  • by gmanen
  • Repository
  • 13 Watchers
  • 0 Stars
  • 12,142 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 29 Versions
  • 1 % Grown

The README.md

ContentBundle

ContentBundle is part of the framework BigFoot created by C2IS., (*1)

Installation

Add 'BigFoot/ContentBundle' into your composer.json file in the 'require' section:, (*2)

``` json "require": { ... ... "bigfoot/content-bundle": "dev-master", }, (*3)


Update your project: ``` shell php composer.phar update

Configuration

In order to add Widgets into the dashboard section, you have to add parameters into your config.yml file., (*4)

# app/config/config.yml
bigfoot_content:
    widgets:
        widget_test: 'Bigfoot\Bundle\ContentBundle\Widget\WidgetTest'
        widget_most_viewed_hotel: 'Bigfoot\Bundle\ContentBundle\Widget\WidgetMostViewedHotel'

Usage

Add a Page:, (*5)

Go to the Page section and manage the pages., (*6)

Add a Static content:, (*7)

Go to the Static Content and manage the static content. Note that all the static content will be listed in the Dashboard section., (*8)

Add a Widget:, (*9)

Add the name and the class of your widget in your config.yml file. (see the Configuration section)., (*10)

Create your class in the Widget directory, it has to extend the abstract class AbstractWidget located in the Model directory., (*11)

/* Widget/WidgetTest.php */

namespace Bigfoot\Bundle\ContentBundle\Widget;

use Bigfoot\Bundle\ContentBundle\Model\AbstractWidget;

class WidgetTest extends AbstractWidget
{

    /**
    * The name of your Widget
    * @return Slug
    */
    public function getName()
    {
        return 'widget_test';
    }

    /**
    * Label of your Widget
    * Displayed in the Dashboard section
    */
    public function getLabel()
    {
        return 'The Widget Test';
    }

    /**
    * Parameters of your Widget
    * These parameters have to be the parameters of the target Action Controller.
    */
    public function getDefaultParameters()
    {
        return array(
            'page_id' => 1
        );
    }

    /**
    * The target Route of your Widget
    * Route of the action controller
    */
    public function getRoute()
    {
        return 'content_page';
    }

    /**
    * Form type of your Widget
    * This is the specific form of your Widget to add your custom parameters
    * The parent have to be `bigfoot_bundle_contentbundle_widgettype`
    */
    public function getParametersType()
    {
        return 'Bigfoot\Bundle\ContentBundle\Form\WidgetTestType';
    }

}

Create the Form Type of your Widget:, (*12)

/* Form/WidgetTestType.php */
namespace Bigfoot\Bundle\ContentBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

class WidgetTestType extends AbstractType
{

    protected $container;

    /**
     * Constructor
     *
     * @param $container
     */
    public function __construct($container)
    {
        $this->container = $container;
    }

    /**
     * @param FormBuilderInterface $builder
     * @param array $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('page_id');

    }

    /**
     * @param OptionsResolverInterface $resolver
     */
    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'Bigfoot\Bundle\ContentBundle\Entity\Widget'
        ));
    }

    /**
     * @return string
     */
    public function getName()
    {
        return 'bigfoot_bundle_contentbundle_widgettesttype';
    }

    /**
    * This method has to return 'bigfoot_bundle_contentbundle_widgettype'
    * @return string
    */
    public function getParent()
    {
        return 'bigfoot_bundle_contentbundle_widgettype';
    }
}

Manage your sidebars

Go to the Dashboard section., (*13)

Create a sidebar:, (*14)

Click on the picto New Sidebar at the right., (*15)

Affect a Widget/Static content to a Sidebar:, (*16)

At the left is listed all your Widgets and Static Contents. Drag'n'drop them to any sidebar., (*17)

Manage the order:, (*18)

You can drag'n'drop any affected Widget/Static Content to sort them up. Validate by clicking on the picto at the left of the Sidebar title., (*19)

The Versions

25/05 2018

dev-master

9999999-dev

Bigfoot Content bundle

  Sources   Download

MIT

The Requires

 

by Guillaume Manen
by SĂ©bastien Huot

30/06 2016

dev-improve-content-bundle

dev-improve-content-bundle

Bigfoot Content bundle

  Sources   Download

MIT

The Requires

 

by Guillaume Manen
by SĂ©bastien Huot

25/01 2016

3.0.x-dev

3.0.9999999.9999999-dev

Bigfoot Content bundle

  Sources   Download

MIT

The Requires

 

by Guillaume Manen
by SĂ©bastien Huot

18/01 2016

3.x-dev

3.9999999.9999999.9999999-dev

Bigfoot Content bundle

  Sources   Download

MIT

The Requires

 

by Guillaume Manen
by SĂ©bastien Huot

06/01 2016

dev-undeprecatization

dev-undeprecatization

Bigfoot Content bundle

  Sources   Download

MIT

The Requires

 

by Guillaume Manen
by SĂ©bastien Huot

27/08 2015

2.2.x-dev

2.2.9999999.9999999-dev

Bigfoot Content bundle

  Sources   Download

MIT

The Requires

 

by Guillaume Manen
by SĂ©bastien Huot

24/08 2015

dev-updaterepo

dev-updaterepo

Bigfoot Content bundle

  Sources   Download

MIT

The Requires

 

by Guillaume Manen
by SĂ©bastien Huot

24/11 2014

v2.2.1

2.2.1.0

Bigfoot Content bundle

  Sources   Download

MIT

The Requires

 

by Guillaume Manen
by SĂ©bastien Huot

24/11 2014

dev-feat-route-manager

dev-feat-route-manager

Bigfoot Content bundle

  Sources   Download

MIT

The Requires

 

by Guillaume Manen
by SĂ©bastien Huot

20/11 2014

2.2

2.2.0.0

Bigfoot Content bundle

  Sources   Download

MIT

The Requires

 

by Guillaume Manen
by SĂ©bastien Huot

10/07 2014

dev-stabilisation

dev-stabilisation

Bigfoot Content bundle

  Sources   Download

MIT

The Requires

 

by Guillaume Manen
by S.Huot

16/06 2014

2.1.x-dev

2.1.9999999.9999999-dev

Bigfoot Content bundle

  Sources   Download

MIT

The Requires

 

by S.Huot

16/06 2014

v2.1.2

2.1.2.0

Bigfoot Content bundle

  Sources   Download

MIT

The Requires

 

by S.Huot

13/06 2014

dev-feat-58

dev-feat-58

Bigfoot Content bundle

  Sources   Download

MIT

The Requires

 

by S.Huot

13/06 2014

v2.1.1

2.1.1.0

Bigfoot Content bundle

  Sources   Download

MIT

The Requires

 

by S.Huot

14/04 2014

v2.1.0

2.1.0.0

Bigfoot Content bundle

  Sources   Download

MIT

The Requires

 

by S.Huot

14/04 2014

dev-context

dev-context

Bigfoot Content bundle

  Sources   Download

MIT

The Requires

 

by S.Huot

31/03 2014

v2.0.0

2.0.0.0

Bigfoot Content bundle

  Sources   Download

MIT

The Requires

 

by S.Huot

21/03 2014

dev-demo

dev-demo

Bigfoot Content bundle

  Sources   Download

MIT

The Requires

 

by S.Huot

20/03 2014

dev-content

dev-content

Bigfoot Content bundle

  Sources   Download

MIT

The Requires

 

by S.Huot

12/02 2014

dev-refacto

dev-refacto

Bigfoot Content bundle

  Sources   Download

MIT

The Requires

 

by S.Huot

21/01 2014

dev-feat-dev-content-dashboard

dev-feat-dev-content-dashboard

Bigfoot Content bundle

  Sources   Download

MIT

The Requires

 

by S.Huot

21/01 2014

v1.0.0

1.0.0.0

Bigfoot Content bundle

  Sources   Download

MIT

The Requires

 

by S.Huot

21/01 2014

v1.0

1.0.0.0

Bigfoot Content bundle

  Sources   Download

MIT

The Requires

 

by S.Huot

13/09 2013

dev-fixbug

dev-fixbug

Bigfoot Content bundle

  Sources   Download

MIT

The Requires

 

by S.Huot

11/09 2013

dev-test

dev-test

Bigfoot Content bundle

  Sources   Download

MIT

The Requires

 

by S.Huot

10/09 2013

dev-bug

dev-bug

Bigfoot Content bundle

  Sources   Download

MIT

The Requires

 

by S.Huot

10/09 2013

dev-fix

dev-fix

Bigfoot Content bundle

  Sources   Download

MIT

The Requires

 

by S.Huot

10/09 2013

dev-shuot

dev-shuot

Bigfoot Content bundle

  Sources   Download

MIT

The Requires

 

by S.Huot