PHP code example of ggggino / sonataextrafields-bundle
1. Go to this page and download the library: Download ggggino/sonataextrafields-bundle library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ggggino / sonataextrafields-bundle example snippets
use Allyou\ManagementBundle\Form\Type\CustomCollectionType;
/**
* @param FormMapper $formMapper
*/
protected function configureFormFields(FormMapper $formMapper)
{
$formMapper
->add('medias', CollectionBuilderType::class, array(
'by_reference' => false,
'wrapper_class' => 'col-xs-4',
'formWizard' => function(FormBuilderInterface $builder) {
// Here you can build your wizard
},
'formWizardPreSetData' => function(FormEvent $event) {
// Here you can set particular
},
'formWizardPreSubmit' => function(FormEvent $event) {
// Here you can manipulate the model before the persist
},
'formWizardOnSubmit' => function(FormEvent $event) {
// Here you can manipulate the model after the persist
}
), array(
'edit' => 'inline',
//'inline' => 'table',
'sortable' => 'position',
'admin_code' => 'app.admin.media',
))
;
}