Skip to content

Instantly share code, notes, and snippets.

View pghoratiu's full-sized avatar
🏠
Working from home

Gabriel Horatiu Petchesi pghoratiu

🏠
Working from home
  • Prolix SRL
  • Oradea, Romania
  • 12:35 (UTC +03:00)
  • X @pghoratiu
View GitHub Profile
@pghoratiu
pghoratiu / symfony errors in form.php
Created March 21, 2012 16:14
Retrieve errors from the from error schema and print it out.
<?php
$msg = '';
foreach( $form->getFormFieldSchema( ) as $name => $formField )
{
if( $formField->getError( ) != "" )
{
$msg = $name . " : " . $formField->getError( );
}
}
@mattattui
mattattui / JobRouteExtension.php
Created July 20, 2011 17:27
Sample Object Route Extension
<?php
namespace Me\MyBundle\Extension;
use Me\MyBundle\Entity\Job;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
class JobRouteExtension extends \Twig_Extension
{
private $generator;