-
Notifications
You must be signed in to change notification settings - Fork 3
View
dongbeta edited this page Jul 28, 2011
·
2 revisions
Xoops Engin use smarty as the template renderer.
The controller providers a view helper to assign variables to template. You don't need to know what a view helper is.
class Demo_IndexController extends Xoops_Zend_Controller_Action
{
public function indexAction()
{
$data = 'Welcome to Xoops!';
$this->template->assign('aString', $data);
}
}
Then, you can use a variable named as aString in the template.
All the template files are put at the directory templates under the application root. The file name is composed as {Controller}{action}.html_ .
The template will be compiled by the smary engine. The delimiters using by Xoops Engine is <{ and }>. So, continue the example above, here is the code in the template:
<div class="example">
<{$aString}>
</div>
The output is:
<div class="example">
Welcome to Xoops!
</div>