2017 © Pedro Peláez
 

symfony-bundle toolbar-bundle

Bundle to add a common toolbar to products developed by 975L.com

image

c975l/toolbar-bundle

Bundle to add a common toolbar to products developed by 975L.com

  • Saturday, May 26, 2018
  • by Laurent3170
  • Repository
  • 1 Watchers
  • 1 Stars
  • 216 Installations
  • PHP
  • 10 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 27 Versions
  • 16 % Grown

The README.md

ToolbarBundle

ToolbarBundle does the following:, (*1)

  • Displays a toolbar,
  • Includes generic tools,
  • Integrates with your web design.

This Bundle relies on the use of Bootstrap and Fontawesome., (*2)

ToolbarBundle dedicated web page., (*3)

ToolbarBundle API documentation., (*4)

Bundle installation

Step 1: Download the Bundle

Use Composer to install the library, (*5)

    composer require c975l/toolbar-bundle

Step 2: Enable the Bundle

Then, enable the bundles by adding them to the list of registered bundles in the app/AppKernel.php file of your project:, (*6)

<?php
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = [
            // ...
            new c975L\ToolbarBundle\c975LToolbarBundle(),
        ];
    }
}

How to use

ToolbarBundle use Fontawesome for icons so you have to load it from your web page. You may use c975L/IncludeLibraryBundle that will allow you to simply add {{ inc_lib('fontawesome', 'css') }} in your layout.html.twig, but if you use c975L/SiteBundle it's already there in stylesheets section :)., (*7)

Create button - toolbar_button()

You can create a button in a Twig template by calling the following code:, (*8)

{{ toolbar_button(path('ROUTE', { 'VARIABLE': object.PROPERTY }), 'BUTTON_NAME', 'SIZE[lg|md|sm|xs](default md)', 'USE_ANOTHER_LABEL', 'USE_ANOTHER_STYLE', 'COLOR') }}
````

### Create button with text - `toolbar_button_text()`

You can create a button with text in a Twig template by calling the following code (data between [] are optional):

```twig
{{ toolbar_button_text(path('ROUTE', { 'VARIABLE': object.PROPERTY }), 'BUTTON_NAME', 'SIZE[lg|md|sm|xs](default md)', 'ICON_DISPLAY[true|false](default true)', 'LOCATION[right|bottom|left|top]', 'USE_ANOTHER_LABEL', 'USE_ANOTHER_STYLE', 'COLOR') }}
````

### Create a toolbar - `toolbar_display`

To create a toolbar, you need to create a template where the tools are defined. Inside this template you can use the Twig Extension `toolbar_button()` or `toolbar_button_text()` to define buttons, like in the following:

```twig
    {# You can add some test and use the object sent #}
    {% if type === 'YOUR_TYPE' %}
        {# You can pass an object and use it there, with the name 'object' #}
        {{ toolbar_button(path('ROUTE', { 'VARIABLE': object.PROPERTY }), 'BUTTON_NAME', 'SIZE[lg|md|sm|xs](default md)', 'USE_ANOTHER_LABEL', 'USE_ANOTHER_STYLE') }}
        {{ toolbar_button_text(path('ROUTE', { 'VARIABLE': object.PROPERTY }), 'BUTTON_NAME', 'SIZE[lg|md|sm|xs](default md)', 'ICON_DISPLAY[true|false](default true)', 'LOCATION[right|bottom|left|top]') }}
    {% endif %}

Then in your templates simply call the Twig extension {{ toolbar_display('TOOLS_TEMPLATE', 'TYPE', 'SIZE[lg|md|sm|xs]', OBJECT_IF_NEEDED, 'ALIGNMENT[left|center|right](default center)') }}., (*9)

You can also specify a css style in your stylesheet for the toolbar:, (*10)

.toolbar {
    margin-bottom: 2em;
}

Note that the Twig extension ToolbarDashboards is specific to 975L developed products, as it will display a dropdown menu link to other products., (*11)

Call from Controller

If you need to call it from a controller, you can do it with the following code:, (*12)

<?php
//...
    $tools = $this->renderView('LOCATION_OF_YOUR_TEMPLATE_DEFINED_ABOVE', array(
        'type' => 'YOUR_TYPE',
        'object' => YOUR_OBJECT_IF_NEEDED,
    ));
    $toolbar = $this->renderView('@c975LToolbar/toolbar.html.twig', array(
        'tools' => $tools,
        'size' => 'YOUR_SIZE',
        'alignment' => 'YOUR_ALIGNMENT',
    ));

If this project help you to reduce time to develop, you can sponsor me via the "Sponsor" button at the top :), (*13)

The Versions

26/05 2018

dev-master

9999999-dev https://github.com/975L/ToolbarBundle

Bundle to add a common toolbar to products developed by 975L.com

  Sources   Download

MIT

The Requires

  • php >=5.5.9

 

bundle symfony

26/05 2018

v1.8.2.3

1.8.2.3 https://github.com/975L/ToolbarBundle

Bundle to add a common toolbar to products developed by 975L.com

  Sources   Download

MIT

The Requires

  • php >=5.5.9

 

bundle symfony

22/05 2018

v1.8.2.2

1.8.2.2 https://github.com/975L/ToolbarBundle

Bundle to add a common toolbar to products developed by 975L.com

  Sources   Download

MIT

The Requires

  • php >=5.5.9

 

bundle symfony

19/05 2018

v1.8.2.1

1.8.2.1 https://github.com/975L/ToolbarBundle

Bundle to add a common toolbar to products developed by 975L.com

  Sources   Download

MIT

The Requires

 

bundle symfony

14/05 2018

v1.8.2

1.8.2.0 https://github.com/975L/ToolbarBundle

Bundle to add a common toolbar to products developed by 975L.com

  Sources   Download

MIT

The Requires

 

bundle symfony

13/05 2018

v1.8.1

1.8.1.0 https://github.com/975L/ToolbarBundle

Bundle to add a common toolbar to products developed by 975L.com

  Sources   Download

MIT

The Requires

 

bundle symfony

13/05 2018

v1.8

1.8.0.0 https://github.com/975L/ToolbarBundle

Bundle to add a common toolbar to products developed by 975L.com

  Sources   Download

MIT

The Requires

 

bundle symfony

15/04 2018

v1.7.2

1.7.2.0 https://github.com/975L/ToolbarBundle

Bundle to add a common toolbar to products developed by 975L.com

  Sources   Download

MIT

The Requires

 

bundle symfony

20/03 2018

v1.7.1

1.7.1.0 https://github.com/975L/ToolbarBundle

Bundle to add a common toolbar to products developed by 975L.com

  Sources   Download

MIT

The Requires

 

bundle symfony

01/03 2018

v1.7

1.7.0.0 https://github.com/975L/ToolbarBundle

Bundle to add a common toolbar to products developed by 975L.com

  Sources   Download

MIT

The Requires

 

bundle symfony

27/02 2018

v1.6.2

1.6.2.0 https://github.com/975L/ToolbarBundle

Bundle to add a common toolbar to products developed by 975L.com

  Sources   Download

MIT

The Requires

 

bundle symfony

26/02 2018

v1.6.1

1.6.1.0 https://github.com/975L/ToolbarBundle

Bundle to add a common toolbar to products developed by 975L.com

  Sources   Download

MIT

The Requires

 

bundle symfony

22/02 2018

v1.6

1.6.0.0 https://github.com/975L/ToolbarBundle

Bundle to add a common toolbar to products developed by 975L.com

  Sources   Download

MIT

The Requires

 

bundle symfony

20/02 2018

v1.5

1.5.0.0 https://github.com/975L/ToolbarBundle

Bundle to add a common toolbar to products developed by 975L.com

  Sources   Download

MIT

The Requires

 

bundle symfony

19/02 2018

v1.4.3

1.4.3.0 https://github.com/975L/ToolbarBundle

Bundle to add a common toolbar to products developed by 975L.com

  Sources   Download

MIT

The Requires

 

bundle symfony

18/02 2018

v1.4.2

1.4.2.0 https://github.com/975L/ToolbarBundle

Bundle to add a common toolbar to products developed by 975L.com

  Sources   Download

MIT

The Requires

 

bundle symfony

18/02 2018

v1.4.1

1.4.1.0 https://github.com/975L/ToolbarBundle

Bundle to add a common toolbar to products developed by 975L.com

  Sources   Download

MIT

The Requires

 

bundle symfony

18/02 2018

v1.4

1.4.0.0 https://github.com/975L/ToolbarBundle

Bundle to add a common toolbar to products developed by 975L.com

  Sources   Download

MIT

The Requires

 

bundle symfony

05/02 2018

v1.3.1

1.3.1.0 https://github.com/975L/ToolbarBundle

Bundle to add a common toolbar to products developed by 975L.com

  Sources   Download

MIT

The Requires

 

bundle symfony

05/02 2018

v1.3

1.3.0.0 https://github.com/975L/ToolbarBundle

Bundle to add a common toolbar to products developed by 975L.com

  Sources   Download

MIT

The Requires

 

bundle symfony

04/02 2018

v1.2.3

1.2.3.0 https://github.com/975L/ToolbarBundle

Bundle to add a common toolbar to products developed by 975L.com

  Sources   Download

MIT

The Requires

 

bundle symfony

04/02 2018

v1.2.2

1.2.2.0 https://github.com/975L/ToolbarBundle

Bundle to add a common toolbar to products developed by 975L.com

  Sources   Download

MIT

The Requires

 

bundle symfony

04/02 2018

v1.2.1

1.2.1.0 https://github.com/975L/ToolbarBundle

Bundle to add a common toolbar to products developed by 975L.com

  Sources   Download

MIT

The Requires

 

bundle symfony

04/02 2018

v1.2

1.2.0.0 https://github.com/975L/ToolbarBundle

Bundle to add a common toolbar to products developed by 975L.com

  Sources   Download

MIT

The Requires

 

bundle symfony

04/02 2018

v1.1.1

1.1.1.0 https://github.com/975L/ToolbarBundle

Bundle to add a common toolbar to products developed by 975L.com

  Sources   Download

MIT

The Requires

 

bundle symfony

04/02 2018

v1.1

1.1.0.0 https://github.com/975L/ToolbarBundle

Bundle to add a common toolbar to several projects developed by 975L.com

  Sources   Download

MIT

The Requires

 

bundle symfony

04/02 2018

v1.0

1.0.0.0 https://github.com/975L/ToolbarBundle

Bundle to add a common toolbar to several projects developed by 975L.com

  Sources   Download

MIT

The Requires

 

bundle symfony