This bundle provides integration for Pulsar into Symfony.
Make sure Composer is installed globally, as explained in the installation chapter of the Composer documentation.
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
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(),
];
// ...
}
// ...
}
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.
{% 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'
})
}}
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.
Created {{ product.createdAt|time_ago }}
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.
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.
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,
]
);
// ...
}
// ...
}