本文整理汇总了PHP中Logging::model方法的典型用法代码示例。如果您正苦于以下问题:PHP Logging::model方法的具体用法?PHP Logging::model怎么用?PHP Logging::model使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Logging
的用法示例。
在下文中一共展示了Logging::model方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: search
public function search($begin, $end)
{
$condition = 'time>=:begin AND time<=:end';
$params = ['begin' => $begin, 'end' => $end];
$model = Logging::model();
$pager = new CPagination($model->count($condition, $params));
$pager->setPageSize(100);
$logging = $model->findAll(['condition' => $condition, 'params' => $params, 'offset' => $pager->getOffset(), 'limit' => $pager->getLimit(), 'order' => 'time desc']);
$this->render('index', ['logging' => new RedArrayDataProvider($logging), 'pager' => $pager]);
}
示例2: actionIndex
public function actionIndex()
{
$pageSize = 10;
$criteria = new CDbCriteria();
//$criteria->condition = 'collumnName1 = :id';
$criteria->order = 'id DESC';
//$criteria->params = array(':id' => $id);
$itemCount = Logging::model()->count($criteria);
$pagination = new CPagination($itemCount);
$pagination->setPageSize($pageSize);
$pagination->applyLimit($criteria);
// the trick is here!
$logEntries = Logging::model()->findAll($criteria);
$this->render('index', array('entries' => $logEntries, 'itemCount' => $itemCount, 'pageSize' => $pageSize, 'pagination' => $pagination));
}
示例3: actionFlush
public function actionFlush()
{
$this->forcePostRequest();
Logging::model()->deleteAll();
$this->redirect($this->createUrl('index'));
}