how to check all variable exist
Exp in Controller return this to pass to twig template :
return $this->render('index/index.html.twig', [ 'department'=>$departments,'URILink'=>$URILink,'departmentDetail'=>$departmentDetails, 'contentCell'=>$this->mContentCell ]);
then twig template can reuse those variable by doin this
index.html.twig:
</div> {{ include ('department_list.html.twig',{'departments':department,'URILink':URILink}) }}</div>
for Comparison in smarty template we can use this:
get_template_vars() — returns assigned variable value(s)
how to do that with same analogy in twig template? in case i want to make sure all variable have been passed correctly
Instead of verifying that each variable exists when you pass it, it's better practice, imho, to utilize the filter
default
in this caseafter read this How to retrieve all Variables from a Twig Template?
i found out just simple
will look all variables passed on a template
You can include a template like this per http://symfony.com/doc/current/book/templating.html#including-other-templates
Or like this per http://twig.sensiolabs.org/doc/tags/include.html
If you want to check
variable
use function indev
mod: