Skip to content

Instantly share code, notes, and snippets.

View nqbao's full-sized avatar
Make Stuff Works

Bao Nguyen nqbao

Make Stuff Works
View GitHub Profile
@nqbao
nqbao / gist:1108862
Created July 27, 2011 07:32
Extra field for entity binding and custom validation in Synfomy 2
<?php
namespace HiveNet\BaseBundle\Form;
use Symfony\Component\Form\FormError;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormValidatorInterface;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilder;
@nqbao
nqbao / gist:1103906
Created July 25, 2011 10:58
Run a command programmtically in Symfony 2
<?php
$drop = $this->getApplication()->get("doctrine:database:drop");
$dropInput = new ArrayInput(array('--force' => '1'), $drop->getDefinition());
$drop->execute($dropInput, $output);
?>