本文整理汇总了PHP中Support::model方法的典型用法代码示例。如果您正苦于以下问题:PHP Support::model方法的具体用法?PHP Support::model怎么用?PHP Support::model使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Support
的用法示例。
在下文中一共展示了Support::model方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadModel
public function loadModel($id)
{
$model = Support::model()->findByPk($id);
if ($model === null) {
throw new CHttpException(404, 'The requested page does not exist.');
}
return $model;
}
示例2: substr
<?php
$hotline = Support::model()->findAll('t.active=1 AND t.delete=0');
$htmlHotline = '';
foreach ($hotline as $item) {
if (!empty($item->phone)) {
$htmlHotline = $htmlHotline . $item->phone . ' (' . $item->name . ') - ';
}
}
echo substr($htmlHotline, 0, -2);
示例3: getTypeOptions
public function getTypeOptions()
{
return CHtml::listData(Support::model()->findAll(), 'id', 'description');
}
示例4: actionDeleteAll
public function actionDeleteAll($id)
{
$arrIdNew = explode(",", $id);
for ($i = 0; $i < count($arrIdNew); $i++) {
// Delete all news of category new
$model = $this->loadModel($arrIdNew[$i]);
if (!empty($model)) {
$criteria = new CDBCriteria();
$criteria->addCondition("group_support_id = {$arrIdNew[$i]}");
$criteria->select = "id";
$arrSupport = Support::model()->findALl($criteria);
foreach ($arrSupport as $support) {
$model_support = Support::model()->find($support->id);
$model_support->delete();
}
}
// Delete category new
$model->delete();
}
if (!isset($_GET['ajax'])) {
$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('index'));
}
}