Jump to content
php.lv forumi

tree navigation


marin4x

Recommended Posts

ka var uztaisit kokveida navigaciju izmantojot Pear

Kods:

Gunkcija kas genere outputu:

 

 

function generateOutput(){ // fill output expression by module html code

 

$mtpl = new IntegratedTemplate($this->incs->modules->value."/".$this->getClassName()."/");

$mtpl->loadTemplatefile($this->getClassName().".tpl.html", true, true);

 

//$this->getTree();

 

$cat_array = Category::getChildren();

//$count_1level=sizeOf($cat_array);

foreach ($cat_array as $cat) {

$elem_id= $cat->getId();

echo $cat->getName()."<br>";

 

if ($cat->hasChildren($cat,active)) {

 

??????????????????? }

}

 

/*

$mtpl->setVariable("IMAGES", $this->html->image->value);

 

 

for ($i=0; $i<10;$i++) {

$mtpl->setCurrentBlock("bubu_block");

$mtpl->setVariable("BUBU",$i);

$mtpl->parseCurrentBlock("bubu_block");

}

 

*/

// $mtpl->touchBlock("address_area");

 

////////////////////////////////////////

// ******* END: MAIN CODE *************

////////////////////////////////////////

 

return $mtpl->get();

}

Link to comment
Share on other sites

Kur tev glabasies tie sadaļu nosaukumi? Ja DB, tad izdoma no sākuma vienkāršu struktūru. Ķipa

[nosaukums][sadalja][apakshsadalja-1][apakshsadalja-2].....

 

Un velkot ara ar pareizu SQL tu dabūsi ko tev vajaga :)

Link to comment
Share on other sites

×
×
  • Create New...