Skip to content

Instantly share code, notes, and snippets.

<?php
use Symfony\Component\Form\AbstractTypeExtension;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\Form\FormBuilderInterface;
class CollectionPrototypeDataTypeExtension extends AbstractTypeExtension {
public function buildForm(FormBuilderInterface $builder, array $options) {
parent::buildForm($builder, $options);
if(($prototypeFormBuilder = $builder->getAttribute('prototype')) && isset($options['prototype_data'])) {
$prototypeFormBuilder->setData($options['prototype_data']);
}
@jumika
jumika / clear_selection.js
Last active August 29, 2015 14:14 — forked from mudassir0909/clear_selection.js
Updated to support changing the title. Also adds a .clear-selection class to the dropdown header for css manipulation.
Selectize.define( 'clear_selection', function ( options ) {
var self = this;
var settings = $.extend({
title: 'Clear selection'
}, options);
//Overriding because, ideally you wouldn't use header & clear_selection simultaneously
self.plugins.settings.dropdown_header = {
title: settings.title
};