I'm trying to figure out how to load a template file and pass it as a variable to another template file while it is being included. In some sense I want to do something like this:
{% include 'component/footer', with 'component/nav' %}
I know I can't do that directly, but in the twig documentation there is an example showing this:
$template = $twig->load('some_template.twig');
$twig->display('template.twig', array('template' => $template));
Is it possible to do the same thing with Craft's twig support?