for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Fi\CoreBundle\Twig\Extension;
use Fi\CoreBundle\Utils\Entity\DoctrineFieldReader;
class ObjectToTabellaExtension extends \Twig_Extension
{
public function getFunctions()
return array(
new \Twig_SimpleFunction('object2view', array($this, 'object2View', 'is_safe' => array('html'))),
new \Twig_SimpleFunction('field2object', array($this, 'field2Object', 'is_safe' => array('html'))),
);
}
public function object2View($object, $type = null)
$dfr = new DoctrineFieldReader($object);
return $dfr->object2View($object, $type);
public function field2Object($fieldtoobj, $object)
return $dfr->getField2Object($fieldtoobj);