Skip to content

Instantly share code, notes, and snippets.

View obenyoussef's full-sized avatar

Oussama Ben Youssef obenyoussef

  • Novactive
  • Tunisia
View GitHub Profile
# install openjdk
sudo apt-get install openjdk-7-jdk
# download android sdk
wget http://dl.google.com/android/android-sdk_r24.2-linux.tgz
tar -xvf android-sdk_r24.2-linux.tgz
cd android-sdk-linux/tools
# install all sdk packages
@obenyoussef
obenyoussef / FormErrorsSerializer.php
Created May 16, 2016 14:37 — forked from Graceas/FormErrorsSerializer.php
Symfony 2 Form Error Serializer. May be used for AJAX form validation. Allows tree and flat array styles for errors.
class FormErrorsSerializer {
public function serializeFormErrors(\Symfony\Component\Form\Form $form, $flat_array = false, $add_form_name = false, $glue_keys = '_')
{
$errors = array();
$errors['global'] = array();
$errors['fields'] = array();
foreach ($form->getErrors() as $error) {
$errors['global'][] = $error->getMessage();
user:
layout: MyBundle::pagelayout.html.twig
login_template: MyBundle:Security:login.html.twig