Skip to content

Instantly share code, notes, and snippets.

@raulfraile
raulfraile / kernel
Created July 21, 2011 15:43
prueba symfony
<?php
namespace { require_once __DIR__.'/autoload.php'; }
namespace Symfony\Component\DependencyInjection
{
@raulfraile
raulfraile / gist:1261181
Created October 4, 2011 08:53
Colorear errores Symfony2 + Twig + Twitter Bootstrap
{% block field_row %}
<div class="clearfix{% if errors|length > 0 %} error{% endif %}">
...
{% endblock %}
@raulfraile
raulfraile / gist:1761071
Created February 7, 2012 18:18
PHP 5.4 tests
=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
Bug #32001 (xml_parse*() goes into infinite loop when autodetection in effect), using UTF-* [ext/xml/tests/bug32001.phpt]
=====================================================================
@raulfraile
raulfraile / gist:1887653
Created February 22, 2012 21:50
Colecciones en formularios de Symfony
/* Form hijo */
<?php
namespace Acme\Bundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilder;
class HijoType extends AbstractType
@raulfraile
raulfraile / gist:1887983
Created February 22, 2012 22:28
Entity hija
/**
* @var Padre
*
* @ORM\ManyToOne(targetEntity="Padre")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="padre_id", referencedColumnName="id")
* })
*/
private $padre;
/**
* @ORM\OneToMany(targetEntity="Hija", mappedBy="padre", cascade={"persist", "remove"})
*/
private $hijas;
@raulfraile
raulfraile / gist:2378458
Created April 13, 2012 17:18
FOSRestBundle new branch
PHP Fatal error: Declaration of FOS\RestBundle\Routing\Loader\RestRouteLoader::setResolver() must be compatible with that of Symfony\Component\Config\Loader\LoaderInterface::setResolver() in [...]/symfony/vendor/bundles/FOS/RestBundle/Routing/Loader/RestRouteLoader.php on line 24
@raulfraile
raulfraile / gist:2585123
Created May 3, 2012 11:36
LiipFunctionalTestBundle ODM fixtures
Doctrine\ORM\Mapping\MappingException: Class Tueddy\TueddyBundle\Document\TimelineEvent is not a valid entity or mapped super class.
/Users/raulfraile/Sites/tueddy/trunk/app/symfony/vendor/doctrine/lib/Doctrine/ORM/Mapping/MappingException.php:147
/Users/raulfraile/Sites/tueddy/trunk/app/symfony/vendor/doctrine/lib/Doctrine/ORM/Mapping/Driver/DriverChain.php:80
/Users/raulfraile/Sites/tueddy/trunk/app/symfony/vendor/doctrine/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php:293
/Users/raulfraile/Sites/tueddy/trunk/app/symfony/vendor/doctrine/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php:178
/Users/raulfraile/Sites/tueddy/trunk/app/symfony/vendor/doctrine/lib/Doctrine/ORM/EntityManager.php:269
/Users/raulfraile/Sites/tueddy/trunk/app/symfony/vendor/doctrine/lib/Doctrine/ORM/UnitOfWork.php:1490
/Users/raulfraile/Sites/tueddy/trunk/app/symfony/vendor/doctrine/lib/Doctrine/ORM/UnitOfWork.php:1468
/Users/raulfraile/Sites/tueddy/trunk/app/symfony/vendor/doctrine/lib/Doctrine/ORM/EntityManager.php:496
@raulfraile
raulfraile / gist:2635353
Created May 8, 2012 14:06
Twig filesystem
$loader = new Twig_Loader_Filesystem('.'); // folder where templates are located
@raulfraile
raulfraile / composer_platform.txt
Created November 9, 2012 22:35
composer show --platform
$ composer show --platform
platform:
ext-apc [3.1.9] : The apc PHP extension
ext-bcmath [0] : The bcmath PHP extension
ext-bz2 [0] : The bz2 PHP extension
ext-ctype [0] : The ctype PHP extension
ext-curl [0] : The curl PHP extension
ext-date [5.3.15] : The date PHP extension
ext-dom [20031129] : The dom PHP extension
ext-ereg [0] : The ereg PHP extension