Giter Site home page Giter Site logo

stanton / pulsar-symfony Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jadu/pulsar-symfony

0.0 1.0 0.0 614 KB

Pulsar components for Symphony

Home Page: http://pulsar.docs.jadu.net

License: MIT License

PHP 71.57% HTML 24.99% JavaScript 3.44%

pulsar-symfony's Introduction

JaduPulsarBundle for Symfony

This bundle provides integration for Pulsar into Symfony.

Installation

Make sure Composer is installed globally, as explained in the installation chapter of the Composer documentation.

Step 1: Download the Bundle

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

$ composer require jadu/pulsar-symfony

Step 2: Enable the Bundle

Then, enable the bundle by adding it to the list of registered bundles in the app/AppKernel.php file of your project:

// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = [
            // ...
            new \Jadu\Bundle\PulsarBundle\JaduPulsarBundle(),
        ];

        // ...
    }

    // ...
}

Usage

Twig Helpers

Pulsar's Twig helpers are automatically registered under the @JaduPulsar namespace.

Information on how to use the twig helpers can be found in the Pulsar Documentation.

Example

{% import '@JaduPulsar/v2/helpers/html.html.twig' as html %}

{{
    html.panel({
        'title': 'In West Philadelphia born and raised',
        'body': 'In the playground was where I spent most of my days.',
        'icon': 'info-sign'
    })
}}

Twig Extensions

Pulsar's Twig extensions are automatically registered into twig.

Some of these helpers are required in order to use the twig helpers or Symfony forms theme.

Example

Created {{ product.createdAt|time_ago }}

Symfony Form Theme

This bundle provides the required twig in order to theme Symfony's built in form types into Pulsar.

It's recommended to setup the theme as the default:

# app/config/config.yml

twig:
    form_themes:
        - '@JaduPulsar/forms.html.twig'

Once registered, generated forms using Symfony's built in form types will be styled into Pulsar.

Additional Symfony Form Types

This bundle provides additional form types for the form components provided by Pulsar which are not built in by Symfony.

These can be found in the Jadu\Bundle\PulsarBundle\Form namespace.

Example

use Jadu\Bundle\PulsarBundle\Form\ToggleSwitchType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;

class MyType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add(
                'enabled',
                ToggleSwitchType::class,
                [
                    'required' => false,
                ]
            );

        // ...
    }

    // ...
}

pulsar-symfony's People

Contributors

stanton avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.