jadu / pulsar-symfony
Integrate Jadu's Pulsar in to Symfony as a bundle
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 20
Forks: 1
Open Issues: 22
Type:symfony-bundle
Requires
- jadu/pulsar: dev-symfony-forms as 10.3.1
- symfony/form: ^3.4
- symfony/framework-bundle: ^3.4
- symfony/twig-bundle: ^3.4
Requires (Dev)
- jadu/php-style: ^1.3
- phpunit/phpunit: ^7.5
- symfony/translation: ^3.4
- symfony/twig-bridge: ^3.4
- symfony/validator: ^3.4
- dev-master
- dev-dependabot/npm_and_yarn/qs-and-grunt-contrib-connect-6.5.3
- dev-dependabot/npm_and_yarn/decode-uri-component-0.2.2
- dev-dependabot/npm_and_yarn/minimatch-and-browserify-and-grunt-and-grunt-contrib-compress-3.0.4
- dev-dependabot/npm_and_yarn/jquery-ui-1.13.2
- dev-dependabot/npm_and_yarn/moment-2.29.4
- dev-dependabot/npm_and_yarn/grunt-1.5.3
- dev-dependabot/npm_and_yarn/minimist-1.2.6
- dev-dependabot/npm_and_yarn/ajv-6.12.6
- dev-dependabot/npm_and_yarn/cached-path-relative-1.1.0
- dev-dependabot/npm_and_yarn/path-parse-1.0.7
- dev-dependabot/npm_and_yarn/glob-parent-5.1.2
- dev-dependabot/npm_and_yarn/hosted-git-info-2.8.9
- dev-dependabot/npm_and_yarn/handlebars-4.7.7
- dev-dependabot/npm_and_yarn/y18n-3.2.2
- dev-dependabot/npm_and_yarn/elliptic-6.5.4
- dev-dependabot/npm_and_yarn/ini-1.3.8
This package is not auto-updated.
Last update: 2024-11-08 05:42:13 UTC
README
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, ] ); // ... } // ... }