本文整理汇总了PHP中Actions::createCondition方法的典型用法代码示例。如果您正苦于以下问题:PHP Actions::createCondition方法的具体用法?PHP Actions::createCondition怎么用?PHP Actions::createCondition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Actions
的用法示例。
在下文中一共展示了Actions::createCondition方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionIndex
public function actionIndex()
{
if (isset($_GET['toggleView']) && $_GET['toggleView']) {
if (Yii::app()->params->profile->oldActions) {
Yii::app()->params->profile->oldActions = 0;
} else {
Yii::app()->params->profile->oldActions = 1;
}
Yii::app()->params->profile->update(array('oldActions'));
$this->redirect(array('index'));
}
$model = new Actions('search');
if (!isset(Yii::app()->params->profile->oldActions) || !Yii::app()->params->profile->oldActions) {
if (!empty($_POST) || !empty(Yii::app()->params->profile->actionFilters)) {
if (isset($_POST['complete'], $_POST['assignedTo'], $_POST['dateType'], $_POST['dateRange'], $_POST['orderType'], $_POST['order'], $_POST['start'], $_POST['end'])) {
$complete = $_POST['complete'];
$assignedTo = $_POST['assignedTo'];
$dateType = $_POST['dateType'];
$dateRange = $_POST['dateRange'];
$orderType = $_POST['orderType'];
$order = $_POST['order'];
$start = $_POST['start'];
$end = $_POST['end'];
if ($dateRange != 'range') {
$start = null;
$end = null;
}
$filters = array('complete' => $complete, 'assignedTo' => $assignedTo, 'dateType' => $dateType, 'dateRange' => $dateRange, 'orderType' => $orderType, 'order' => $order, 'start' => $start, 'end' => $end);
} elseif (!empty(Yii::app()->params->profile->actionFilters)) {
$filters = json_decode(Yii::app()->params->profile->actionFilters, true);
}
$condition = Actions::createCondition($filters);
$dataProvider = $model->search($condition, Actions::ACTION_INDEX_PAGE_SIZE);
$params = $filters;
} else {
$dataProvider = $model->search(null, Actions::ACTION_INDEX_PAGE_SIZE);
$params = array();
}
$this->render('index', array('model' => $model, 'dataProvider' => $dataProvider, 'params' => $params));
} else {
$this->render('oldIndex', array('model' => $model));
}
}