本文整理汇总了PHP中Addons::model方法的典型用法代码示例。如果您正苦于以下问题:PHP Addons::model方法的具体用法?PHP Addons::model怎么用?PHP Addons::model使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Addons
的用法示例。
在下文中一共展示了Addons::model方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
</div>
<br><br>
<div id="header">
</div><!-- header -->
<div id="mainmenu">
<?php
$this->widget('zii.widgets.CMenu', array('items' => array(array('label' => 'Items', 'url' => array('/items/freeSearch/')), array('label' => 'Inbound', 'url' => array('/items/inboundSearch')), array('label' => 'Outbound', 'url' => array('/items/outboundSearch')), array('label' => 'Purchase Order', 'url' => array('/purchaseOrder/admin')), array('label' => 'ItemsOnOrder', 'url' => array('/itemOnOrder/admin')), array('label' => 'Set Up', 'url' => array('/setup/view&id=1')), array('label' => 'Back Up', 'url' => array('/site/backup'), 'visible' => !Yii::app()->user->isGuest))));
?>
</div><!-- mainmenu -->
<div id='submenu' style="text-align:center">
<?php
$addons_list = Addons::model()->findAll(array('condition' => 'active=1'));
foreach ($addons_list as $addon) {
echo "<li>";
echo CHtml::link($addon->addon_label, array('/' . $addon->name));
echo "</li>";
}
?>
</div>
<?php
if (isset($this->breadcrumbs)) {
示例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 the ID of the model to be loaded
*/
public function loadModel($id)
{
$model = Addons::model()->findByPk($id);
if ($model === null) {
throw new CHttpException(404, 'The requested page does not exist.');
}
return $model;
}