Skip to content

Instantly share code, notes, and snippets.

View fsevestre's full-sized avatar
☄️
Vague destructrice de la tortue

Florent SEVESTRE fsevestre

☄️
Vague destructrice de la tortue
View GitHub Profile
@fsevestre
fsevestre / bootstrap_3_layout.html.twig
Created May 30, 2017 19:43
[Symfony 2 / Bootstrap 3] Form errors in tooltips or popovers
{% extends 'bootstrap_3_layout.html.twig' %}
{% block form_row -%}
{% if (form_errors_in_tooltip is defined and form_errors_in_tooltip) or (form_errors_in_popover is defined and form_errors_in_popover) %}
<div class="form-group{% if (not compound or force_error|default(false)) and not valid %} has-error{% endif %}">
{{ form_label(form) }}
{{ form_errors(form) }}
{{ form_widget(form) }}
</div>
{% else %}
@fsevestre
fsevestre / BooleanType.php
Last active December 26, 2018 16:15
Boolean form type for Symfony2 + tests (library: https://github.com/fsevestre/BooleanFormType)
<?php
namespace AppBundle\Form\Type;
use AppBundle\Form\DataTransformer\BooleanTypeToBooleanTransformer;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class BooleanType extends AbstractType
@fsevestre
fsevestre / Serializor.php
Created November 20, 2015 22:27 — forked from bubba-h57/Serializor.php
Doctrine 2 Entities Serialized to JSON
<?php
namespace H57\Util;
class Serializor {
/**
* Converts the Doctrine Entity into a JSON Representation
*
* @param object $object The Object (Typically a Doctrine Entity) to convert to an array
@fsevestre
fsevestre / README.md
Last active March 26, 2017 16:58
Symfony 2 breadcrumbs based on KnpMenuBundle (KnpMenu 2.1)