I went looking to see how Symfony's extended Twig function form_widget actually works. I was expecting to find the function in symfony / src / Symfony / Bridge / Twig / Extension / FormExtension.php . It's added to the function list there:
public function getFunctions()
{
return array(
...
new \Twig_SimpleFunction('form_widget', null, array('node_class' => 'Symfony\Bridge\Twig\Node\SearchAndRenderBlockNode', 'is_safe' => array('html'))),
...
);
}
But no callable is listed (ie the 2nd arg is null). So what code is called when I use form_widget(a_form_element) in a Twig template?