MarkupFieldBundle
, (*1)
This bundle provides a markup form field for Symfony.
This bundle is useful to create fake field wich contains text or HTML., (*2)
Installation
Installation
To install MarkupFieldBundle with Composer just type in your terminal:, (*3)
php composer.phar require mdespeuilles/markupfieldbundle
Now update your AppKernel.php
file, and
register the new bundle:, (*4)
<?php
// in AppKernel::registerBundles()
$bundles = array(
// ...
new Mdespeuilles\MarkupFieldBundle\MdespeuillesMarkupFieldBundle(),
// ...
);
Usage
When creating a new form class add the following line to create the field:, (*5)
``` php
<?php, (*6)
use Mdespeuilles\MarkupFieldBundle\Form\Type\MarkupType;, (*7)
public function buildForm(FormBuilder $builder, array $options)
{
// ...
$builder->add('markup', MarkupType::class, [
'markup' => 'hello word !'
]);
// ...
}
```, (*8)