Re: Hello There, Little Question Regarding Savant

223 views
Skip to first unread message

Brett Bieber

unread,
Mar 20, 2011, 4:49:30 PM3/20/11
to Yahav Shasha, phps...@googlegroups.com


On Sun, Mar 20, 2011 at 7:54 AM, Yahav Shasha <yahav....@gmail.com> wrote:
Hello Brett,
I Found Savant as a really clean yet solid alt to Smarty,
one question though:
say i want to include X.tpl.php to Y.tpl.php is it something that i can do?
in smarty that would be:
{include file='cp/header.tpl'}
so i guess with Savant i can just simply use
<? include("/tpls/x.tpl.php");?>
inside the Y.tpl.php file?
would this work fine?

Sure, you can do that with savant. Or you can also use: $this->display('x.tpl.php');

If you're looking for isolated child templates with inheritance, you might try Savvy (next generation of Savant), which is in beta right now. In Savvy, you'd use <?php echo $savvy->render($context->data, 'x.tpl.php'); ?>, then inside x.tpl.php you can use $parent->context; to access the parent context.

https://github.com/saltybeagle/Savvy


--
Brett Bieber
Reply all
Reply to author
Forward
0 new messages