I want to call the function of from the controller in twig.How can i do it
It is my controller
class ArticleController extends Controller
{
/**
* @Route("Article")
*/
public function indexAction()
{
.......................
return $this->render('MainBundle:Article:index.html.twig', array(
'lastArticleCategoryData' => $lastArticleCategoryData
));
}
public function datajalali()
{
$articles = "sss";
$v = new Verta(); //1396-02-02 15:32:08
$v = Verta::now();
return $v;
}
}
My twig
{% if Article.datajalali %}
{{ datajalali }}
{% endif %}