The RizewayFormBundle
offers new Form Types for your Symfony2 Project
- rizeway_tinymce
- rizeway_autocompleter
- rizeway_jqueryui_autocompleter
- rizeway_xoxco_autocompleter
git submodule add git://github.com/youknowriad/RizewayFormBundle.git src/Rizeway/FormBundle
// app/autoload.php
$loader->registerNamespaces(array(
'Rizeway' => __DIR__.'/../src',
// Other namespaces
));
// app/AppKernel.php
public function registerBundles()
{
return array(
// ...
new Rizeway\FormBundle\RizewayFormBundle(),
// ...
);
}
These types allow you to add autocomplete fields that accept multiple values (Example: tags)
$builder->add('tags', 'rizeway_jqueryui_autocompleter', array(
'url' => '/tags/get',
));
or
$builder->add('tags', 'rizeway_xoxco_autocompleter', array(
'url' => '/tags/get',
));
or
$builder->add('tags', 'rizeway_autocompleter', array(
'url' => '/tags/get',
'must_match' => true
));
the rizeway_jqueryui_autocompleter
type is based on the jQueryUI Autocomplete Widget
the rizeway_xoxco_autocompleter
type is based on the Xoxco jQuery Tags Input Widget
The type have a value_transformer
option. By default, the dataTransformer used
transforms the input values separated by ',' to an array of values.
You can write your own transform for example to get an ArrayCollection of Entities.
$builder->add('content', 'rizeway_tinymce');