本文整理汇总了PHP中Part::model方法的典型用法代码示例。如果您正苦于以下问题:PHP Part::model方法的具体用法?PHP Part::model怎么用?PHP Part::model使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Part
的用法示例。
在下文中一共展示了Part::model方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTree
private function getTree()
{
if ($root = Part::model()->find('alias="carclub"')) {
$tree = $this->convertMenuTree($root->getNestedTree());
}
return $tree;
}
示例2: loadModel
/**
* 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;
}
示例3:
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');
示例4: array
<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
}
?>
示例5: loadModel
public function loadModel($id)
{
$model = Part::model()->roots()->findByPk((int) $id);
if ($model === null) {
throw new CHttpException(404, 'Запрашиваемая страница не существует.');
}
return $model;
}