previousSetting variables (Previous) (Next) Finish & outputnext

View this page in Last updated: Sun, 18 Oct 2009
English | Brazilian Portuguese | Chinese | Dutch | French | German | Hungarian | Japanese | Polish | Russian | Spanish | Turkish

Parsing blocks

Once you filled all variables in a block, you want to "save" them to be able to re-use the block another time. Method parse() is useful here. First parameter is the variable/handle in which the block content shall be stored, second is the handle name of the block. The optional third parameter tells if you want to append the block content to the handle value or not - it defaults to false, but you probably want to do that.

Parsing a block

<?php
foreach ($authors as $name => $email) {
    
$t->setVar('AUTHOR_NAME'$name);
    
$t->setVar('AUTHOR_EMAIL'$email);
    
$t->parse('authorline_ref''authorline'true);
}
?>

In this example, handle authorline_ref is filled with the contents of block authorline. If the third parameter would be false instead of true, only the last line would be in it at the end.

previousSetting variables (Previous) (Next) Finish & outputnext

Download Documentation Last updated: Sun, 18 Oct 2009
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
There are no user contributed notes for this page.