<?php if ($this->topid == 8) { ?> <?php echo $content; } else { ?> <div class="container_16"> <div class="content-left left"> <?php $this->widget('zii.widgets.CMenu', array('items' => Typelist::model()->getMenuItems($this->topid, true))); ?> <?php /* $loadmodels=Typelist::model()->items($this->topid); //print_r($loadmodels); foreach($loadmodels as $modelskey=>$modelsvalue) { foreach($modelsvalue as $key=>$value) { echo '<div class="navigation-text">'; echo CHtml::link(CHtml::encode($value),Yii::app()->createUrl('site/view', array( 'linkid'=>$key, 'typename'=>$value, ))); echo '</div> ';
public function getMenuData() { return Typelist::model()->getMenuItems(51, false); }
<?php if (Yii::app()->layout == 'print') { ?> <?php echo $content; ?> <?php } else { ?> <div class="container_16"> <div class="content-left left"> <?php $loadmodels = Typelist::model()->items(8); foreach ($loadmodels as $models) { foreach ($models as $key => $value) { switch ($key) { case 8: $a[] = $value; break; case 9: $b[] = $value; break; case 10: $c[] = $value; break; case 11: $d[] = $value; break;
<?php //$menu=Typelist::model()->getTreeItems(34,false); $this->leftPortlets['ptl.WidgetMenu'] = array(); ?> <?php //echo print_r(Typelist::model()->getMenuSubItems()); echo "<br /><br /><br /><br />"; echo print_r(Typelist::model()->getWidth()); echo "<br /><br /><br /><br />"; $this->widget('zii.widgets.CMenu', array('items' => Typelist::model()->getTreeItems(34, false))); print_r(Typelist::model()->filltree(34)); ?>
private static function loadItems($topid) { $models = self::model()->findAll(array('condition' => 'topid=:topid', 'params' => array(':topid' => $topid), 'order' => 'tid')); foreach ($models as $model) { $model->linkid > 0 ? $_id = $model->linkid : ($_id = $model->upid); self::$_upid = array($_id => $model->typename); self::$_items[] = self::$_upid; } return self::$_items; }