hey, Since a few weeks I'm try to program a PHP-Application with the smarty template solution. Now a easy question for all professionals: How can I get a Template in a Template ? One example: index.php (page.tpl) include my login.php (login.tpl)
In the smarty documentation I have found this function:
{include file="$tpl_name.tpl"}
But where is my login.php controller ? When this function include the login.tpl file, I have only HTML code or ?
Can someone explain me this or give me a sample / tutorial ?
Sorry for my bad english
best regards
That code is exactly what you want. It will let you include another smarty template from within a template.
<html>
<head>
<title>{$title}</title>
</head>
<body>
{include file='login.tpl'}
All variables available to the original template, are available to the template you just included.
Im not sure what you're saying about only having HTML code, maybe you're wanting this function instead:
{include_php file='/path/to/login.php'}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With