IT flow parser (was: an HTML_Template_IT[X] fork is available)

From: Date: Tue, 11 Feb 2003 19:05:25 +0000
Subject: IT flow parser (was: an HTML_Template_IT[X] fork is available)
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-13131@lists.php.net to get a copy of this message
<kvn@phbme.ntu-kpi.kiev.ua> wrote : > Hello everyone! > I have one question about using HTML_Template_IT.php > can IT hanle this situation? : > > I want to made highlighting of selected menu item.. > > $menu = $page->getAdminMenu($a); // $a = auth. > $t->setCurrentBlock('menu_item'); > foreach ($menu as $item) { > if ($page->isSelected($item)) { > $t->setCurrentBlock('menu_item_selected'); > } > $t->setVariable(array( > "MENU_URL" => $item[url], > "MENU_NAME" => $item[name], > )); > $t->parseCurrentBlock(); > } > > template: > <!-- BEGIN menu --> > <!-- BEGIN menu_item --> > <a href="{MENU_URL}">{MENU_NAME}</a><br> > <!-- END menu_item --> > <!-- BEGIN menu_item_selected --> > <b><u><a > href="{MENU_URL}">{MENU_NAME}</a></b></u><br> > <!-- END menu_item_selected --> > > <!-- END menu --> > > In that way menu_item_selected always on bottom (after all menu items in > list). > I made this in this way: > <!-- BEGIN menu_item --> > {SELECTED_MENU_ITEM_PRE} > <a href="{MENU_URL}">{MENU_NAME}</a><br> > {SELECTED_MENU_ITEM_POST} > <!-- END menu_item --> > > and $page->isSelected($item), then $t->setVariable("SELECTED_MENU_ITEM", > '<b><u>'); ... and so on... > But it's not very good solution, and I can't found this like situation > in documentation.. > Can anyone IT user or IT lead developer help me? > > Thank you very much. Unfortunately, I don't think that's possible. It would make a really useful addition to the current code. I also need this to integrate IT with QuickForm. Some sort of flow parser. I wish a (lead) developer could come up with a solution ;) Bertrand Mansion Mamasam

« previous php.pear.dev (#13131) next »