Date: 07/28/01
- Next message: Jakob: "[phplib] ct_split_sql question"
- Previous message: nathan r. hruby: "Re: [phplib] Windows + PHPlib"
- In reply to: Bertrand Mansion: "Re: [phplib] IT[X] example"
- Next in thread: Bertrand Mansion: "Re: [phplib] IT[X] example"
- Reply: Bertrand Mansion: "Re: [phplib] IT[X] example"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hello,
Thanks a lot for your answer, but I am not really able to get it to work.
I have the followeing code:
$tpl = new IntegratedTemplateExtension("templates/");
$tpl->loadTemplatefile("page.inc.htm", true, true);
$tpl->addBlockfile( "CONTENTS", "block_contents", "content.inc.htm");
$tpl->setCurrentBlock("block_contents");
$tpl->parseCurrentBlock();
for($i0 = 0; $i0 <= 5; ++$i0 )
{
for( $i1 = 0; $i1 < 4; ++$i1 )
{
$a_Tpl->setCurrentBlock("inner_block");
$a_Tpl->setVariable( "VAR1", "test1" );
$a_Tpl->setVariable( "VAR2", "test2" );
$a_Tpl->parseCurrentBlock();
}
$a_Tpl->setCurrentBlock("outer_block");
$a_Tpl->setVariable( "VAR1", "test1" );
$a_Tpl->setVariable( "VAR2", "test2" );
$a_Tpl->parseCurrentBlock();
}
$tpl->show();
And there are two templates, the page.inc.htm (With two blocks inner_block,
outer_block and the variable {CONTENTS}) and content.inc.htm (with the block
block_contents)
If I do that I have the following error:
Warning: Invalid argument supplied for foreach() in IT.php on line 424
The inner and outer block are parsed like they should be, but where the
{CONTENTS} Variable was, there is nothing...
Would be great if somebody could help me !
Thanks
Iwan
----- Original Message -----
From: "Bertrand Mansion" <bmansion <email protected>>
le 27/07/01 20:32, Iwan Birrer à iwanbirrer <email protected> a écrit :
> Hello,
>
> Is there anybody who has a working Example using the Integrated Template
> Extension ?
> I can't get it to work. (The addBlockfile() seems not to work ..)
>
> Thanks for all answers..
>
> Iwan
>
Hi Iwan,
I have made a fix for ITX that make addBlock and addBlockfile work. As ITX
is also part of PEAR, I have only commited this fix to PEAR (because I
believe it is the best place for this kind of extensions to reside). If you
want a working version, go to http://cvs.php.net and in directory
php4/pear/HTML you will find the corrected version, but you will need
pear.php.
Maybe someone with cvs access to phplib can use the diffs to correct phplib
version (I think it is really stupid to have itx in 2 places...).
It is pretty easy to use, there might be examples in previous posts.
Bertrand Mansion
Mamasam
-- Abbestellen mit Mail an: phplib-unsubscribe <email protected> Kommandoliste mit Mail an: phplib-help <email protected>
- Next message: Jakob: "[phplib] ct_split_sql question"
- Previous message: nathan r. hruby: "Re: [phplib] Windows + PHPlib"
- In reply to: Bertrand Mansion: "Re: [phplib] IT[X] example"
- Next in thread: Bertrand Mansion: "Re: [phplib] IT[X] example"
- Reply: Bertrand Mansion: "Re: [phplib] IT[X] example"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

