private function getTree() { if ($root = Part::model()->find('alias="carclub"')) { $tree = $this->convertMenuTree($root->getNestedTree()); } return $tree; }
/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer $id the ID of the model to be loaded * @return PvPn the loaded model * @throws CHttpException */ public function loadModel($id) { $model = Part::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
echo $form->labelEx($model, 'order_id'); ?> <?php echo CHtml::textField('order_id', $model->order->name); ?> <?php echo $form->error($model, 'order_id'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'part_id'); ?> <?php echo $form->dropDownList($model, 'part_id', CHtml::listData(Part::model()->findAll(array('order' => 'PNPartNumber')), 'id', 'PNPartNumber')); ?> <?php echo $form->error($model, 'part_id'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'desired_qty'); ?> <?php echo $form->textField($model, 'desired_qty'); ?> <?php echo $form->error($model, 'desired_qty');
<div class='logo'><a href='/'><?php echo Yii::app()->name; ?> </a></div> <?php echo CHtml::link(Yii::app()->user->name, array('show' => Yii::app()->user->id)); ?> <?php echo CHtml::link('выход', array('/logout')); ?> </div> <?php #$this->widget('admin.widgets.MainMenu'); ?> <?php $this->widget('admin.widgets.menu2.menu2', array('items' => Part::model()->tree('admin'))); ?> <div class="content"> <?php if (!empty($this->menu)) { ?> <div class="operations"> <?php $this->widget('zii.widgets.CMenu', array('items' => $this->menu)); ?> <br clear="both" /> </div> <?php } ?>
public function loadModel($id) { $model = Part::model()->roots()->findByPk((int) $id); if ($model === null) { throw new CHttpException(404, 'Запрашиваемая страница не существует.'); } return $model; }