Date: 01/15/01
- Next message: Alexandr E. Bravo: "[phplib] menu.inc troubles under PHP4.04pl1"
- Previous message: Ignatius Teo: "RE: [phplib] Call Time Pass By Reference PROBLEM."
- In reply to: Marko Kaening: "[phplib] integrated template question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi Marko,
sorry for the delayed answer.
Marko Kaening wrote:
> I played a bit with the code in the attachment, but what was strange for
Haven't looked at it yet. Maybe I can manage to do so later on.
> me was that the outcommented line marked with '???' causes a doubled
> output of block2 with unsubstituted vars. What happened? It looks like
Generally speaking: make sure that you parse the innermost block first.
Otherwise you're corrupting the variable cache.
This must to parse the innermost block first is the price of the simpler
block API.
> one needs to call the parseCurrentBlock() only if there are more than one
> multiple blocks to display.????
Will have a look at it later on.
> How can I delete a block?
Empty block get deleted automatically (unless you touched them to be
preserved).
/**
* RegExp used to strip unused variable placeholder.
* <email protected> $variablesRegExp
*/
var $removeVariablesRegExp = "";
/**
* Controls the handling of unknown variables, default is remove.
* <email protected> boolean
* <email protected> public
*/
var $removeUnknownVariables = true;
/**
* Controls the handling of empty blocks, default is remove.
* <email protected> boolean
* <email protected> public
*/
var $removeEmptyBlocks = true;
> Is anything like example files somewhere available or in sight to come?
No, but PHPDoc uses IT and the new form_flow_layout.inc does also. Maybe
I can give you
an example later this week.
* To add content to block1 you simply type:
* <code>$tpl->setCurrentBlock("block1");</code>
* and repeat this as often as needed:
* <code>
* $tpl->setVariable(...);
* $tpl->parseCurrentBlock();
* </code>
*
* To add content to block2 you would type something like:
* <code>
* $tpl->setCurrentBlock("inner1");
* $tpl->setVariable(...);
* $tpl->parseCurrentBlock();
*
* $tpl->setVariable(...);
* $tpl->parseCurrentBlock();
*
* $tpl->parse("block1");
* </code>
*
* This will result in one repition of block1 which contains two
repitions
* of inner1. inner2 will be removed if $removeEmptyBlock is set to true
which is the default.
*
* Usage:
* <code>
* $tpl = new IntegratedTemplate( [string filerootdir] );
*
* // load a template or set it with setTemplate()
* $tpl->loadTemplatefile( string filename [, boolean
removeUnknownVariables, boolean removeEmptyBlocks] )
*
* // set "global" Variables meaning variables not beeing within a
(inner) block
* $tpl->setVariable( string variablename, mixed value );
*
* // like with the Isotemplates there's a second way to use
setVariable()
* $tpl->setVariable( array ( string varname => mixed value ) );
*
* // Let's use any block, even a deeply nested one
* $tpl->setCurrentBlock( string blockname );
*
* // repeat this as often as you need it.
* $tpl->setVariable( array ( string varname => mixed value ) );
* $tpl->parseCurrentBlock();
*
* // get the parsed template or print it: $tpl->show()
* $tpl->get();
> P.S.: I guess the style of the ihtml file should be almost identical to
> the current standard template files, right? The only unclear role plays
> for me the __global__ block... How this should be defined and used?
__global__ is an internal placeholder used while processing the
template. Do not play with it unless you know how IT[X] works.
Ulf
---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>
- Next message: Alexandr E. Bravo: "[phplib] menu.inc troubles under PHP4.04pl1"
- Previous message: Ignatius Teo: "RE: [phplib] Call Time Pass By Reference PROBLEM."
- In reply to: Marko Kaening: "[phplib] integrated template question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

