public function actioncxIndex() { //print_r( ucfirst($this->getId() ) ); //$this->actionId = $this->getAction()->getId(); $controllerId = $this->controllerId; $criteria = new CDbCriteria(); if (isset($_GET['keyword']) || !empty($_GET['keyword']) || strlen($_GET['keyword']) > 0) { $keyword = trim($_GET['keyword']); $criteria->condition = 'title like :keyword '; $criteria->params = array(':keyword' => "%{$keyword}%"); $is_partial = true; } $imodel = new $controllerId(); $item_count = call_user_func(array($imodel, 'count'), $criteria); $page_size = 10; $pages = new CPagination($item_count); $pages->setPageSize($page_size); $pagination = new CLinkPager(); $pagination->cssFile = false; $pagination->setPages($pages); $pagination->init(); $criteria->limit = $page_size; $criteria->offset = $pages->offset; $select_pagination = new CListPager(); $select_pagination->header = '跳转到:'; $select_pagination->htmlOptions['onchange'] = ""; $select_pagination->setPages($pages); $select_pagination->init(); $list = call_user_func(array($imodel, 'findAll'), $criteria); if ($is_partial) { $this->renderPartial('_index', array('list' => $list, 'pagination' => $pagination, 'select_pagination' => $select_pagination), false, true); } else { $this->render('index', array('list' => $list, 'pagination' => $pagination, 'select_pagination' => $select_pagination), false, true); } }
public function actionPickAtt() { $return_id = $_GET['return_id']; $rtype = $_GET['rtype']; $criteria = new CDbCriteria(); if (isset($_GET['keyword'])) { $screen_name = trim($_GET['keyword']); $criteria->condition = 'screen_name like :screen_name'; $criteria->params = array(':screen_name' => "%{$screen_name}%"); $partial_tpl = '_att'; //$atts = Attachment::model()->findAll($criteria); //$this->renderPartial('_att',array('return_id' => $return_id,'atts' => $atts,'rtype' => $rtype ),false,true); } else { $partial_tpl = 'pickatt'; //$atts = Attachment::model()->findAll(); //$this->renderPartial('pickatt',array('return_id' => $return_id,'atts' => $atts ,'rtype' => $rtype ),false,true); } $item_count = Attachment::model()->count($criteria); $page_size = 10; $pages = new CPagination($item_count); $pages->setPageSize($page_size); $pagination = new CLinkPager(); $pagination->cssFile = false; $pagination->setPages($pages); $pagination->init(); $criteria->limit = $page_size; $criteria->offset = $pages->offset; $select_pagination = new CListPager(); $select_pagination->htmlOptions['onchange'] = ""; $select_pagination->setPages($pages); $select_pagination->init(); $atts = Attachment::model()->findAll($criteria); $this->renderPartial($partial_tpl, array('return_id' => $return_id, 'atts' => $atts, 'rtype' => $rtype, 'pagination' => $pagination, 'select_pagination' => $select_pagination), false, true); }
public function index() { //当前页码 $nowpage = isset($_GET['pageIndex']) ? trim($_GET['pageIndex']) : 1; //审核状态 $auditstatus = isset($_GET['auditstatus']) ? trim($_GET['auditstatus']) : null; $cp = new CommonPRM(); $pageInfo = new PageInfo(); $pageInfo->nowpage = $nowpage; $pageInfo->pagesize = 10; $cp->pageinfo = $pageInfo; $btbTrainingplanOutlinePRM = new BtbTrainingplanOutlinePRM(); if (!is_null($auditstatus)) { if (is_numeric($auditstatus)) { //auditstatus不为空赋予查询条件 $btbTrainingplanOutlinePRM->auditstatus = $auditstatus; //分页跳转的时候保证查询条件 $urlPrefix = 'OutlineList/index?auditstatus=' . $auditstatus; } } else { $urlPrefix = 'OutlineList/index'; } //教练id coach_id // $ses = SessionData::getAttribute('loginUserInfo'); // if(isset($ses)) // { // $coach_id = $ses['id']; // } $coach_id = $this->getLoginUserID(); // dump($coach_id); // exit; //获取登录者的信息 $user = $this->getLoginInfo(); //课程大纲EntityList $btbTrainingplanOutlinePRM->order_by = 'id DESC'; $btbTrainingplanOutlinePRM->coach_id = $coach_id; $trainingplanOutlineList = BtbTrainingplanOutlineBLL::getTrainingplanOutlineList($cp, $btbTrainingplanOutlinePRM); $page = new CLinkPager($pageInfo->totalcount, $pageInfo->pagesize, $urlPrefix); $show = $page->show(); $this->assign('auditstatus', $auditstatus); $this->assign('totalcount', $pageInfo->totalcount); $this->assign('page', $show); $this->assign('trainingplanOutlineList', $trainingplanOutlineList); $this->assign('addtype', 6); //menu课程大纲 $this->assign('headtype', 1); //课程管理1还是课程审核页面0 $this->assign('coachtype', $user['type']); //$this->display("OutlineList/index"); $this->display("Outline/index"); }
/** * Initializes the pager by setting some default property values. */ public function init() { if ($this->nextPageLabel === null) { $this->nextPageLabel = '→'; } if ($this->prevPageLabel === null) { $this->prevPageLabel = '←'; } $classes = array(); // $validAlignments = array(self::ALIGNMENT_CENTER, self::ALIGNMENT_RIGHT); // // if (in_array($this->alignment, $validAlignments)) // $classes[] = 'pagination-'.$this->alignment; $classes[] = 'pagination'; $validSizes = array(self::SIZE_LARGE, self::SIZE_SMALL, self::SIZE_MINI); if (isset($this->size) && in_array($this->size, $validSizes)) { $classes[] = 'pagination-' . $this->size; } if (!empty($classes)) { $classes = implode(' ', $classes); if (isset($this->htmlOptions['class'])) { $this->htmlOptions['class'] = ' ' . $classes; } else { $this->htmlOptions['class'] = $classes; } } parent::init(); }
/** * Initializes the pager by setting some default property values. */ public function init() { if ($this->nextPageLabel === null) { $this->nextPageLabel = Yii::t('bootstrap', 'Next') . ' →'; } if ($this->prevPageLabel === null) { $this->prevPageLabel = '← ' . Yii::t('bootstrap', 'Previous'); } if ($this->firstPageLabel === null) { $this->firstPageLabel = Yii::t('bootstrap', 'First'); } if ($this->lastPageLabel === null) { $this->lastPageLabel = Yii::t('bootstrap', 'Last'); } $classes = array(); $validAlignments = array(self::ALIGNMENT_LEFT, self::ALIGNMENT_CENTER, self::ALIGNMENT_RIGHT); if (in_array($this->alignment, $validAlignments)) { $classes[] = 'pagination-' . $this->alignment; } $classes = implode(' ', $classes); if (isset($this->htmlOptions['class'])) { $this->htmlOptions['class'] = ' ' . $classes; } else { $this->htmlOptions['class'] = $classes; } parent::init(); }
/** * Initializes the pager by setting some default property values. */ public function init() { if ($this->header === null) { $this->header = ''; } // Bootstrap does not use a header if ($this->nextPageLabel === null) { $this->nextPageLabel = Yii::t('bootstrap', 'Next') . ' →'; } if ($this->prevPageLabel === null) { $this->prevPageLabel = '← ' . Yii::t('bootstrap', 'Previous'); } if ($this->firstPageLabel === null) { $this->firstPageLabel = Yii::t('bootstrap', 'First'); } if ($this->lastPageLabel === null) { $this->lastPageLabel = Yii::t('bootstrap', 'Last'); } if ($this->cssFile === null) { $this->cssFile = false; } // Bootstrap has its own css if (!isset($this->htmlOptions['class'])) { $this->htmlOptions['class'] = ''; } // would default to yiiPager parent::init(); }
/** * ### .init() * * Initializes the pager by setting some default property values. */ public function init() { $this->registerScript(); $this->registerCss(); $classes = array(); $validAlignments = array(self::ALIGNMENT_CENTER, self::ALIGNMENT_RIGHT); if (in_array($this->alignment, $validAlignments)) { $classes[] = 'pagination-' . $this->alignment; } if (!empty($classes)) { $classes = implode(' ', $classes); if (isset($this->htmlOptions['class'])) { $this->htmlOptions['class'] = ' ' . $classes; } else { $this->htmlOptions['class'] = $classes; } } if ($this->nextPageLabel === null) { $this->nextPageLabel = Yii::t('yii', '>'); } if ($this->prevPageLabel === null) { $this->prevPageLabel = Yii::t('yii', '<'); } if ($this->firstPageLabel === null) { $this->firstPageLabel = Yii::t('yii', '<<'); } if ($this->lastPageLabel === null) { $this->lastPageLabel = Yii::t('yii', '>>'); } if ($this->header === null) { $this->header = Yii::t('yii', 'Go to page: '); } parent::init(); }
/** * Lists all models. */ public function actionIndex($opt = null) { $controllerId = strlen($opt['controllerId']) > 0 ? $opt['controllerId'] : $this->controllerId; if (!is_array($opt)) { $criteria = new CDbCriteria(); $keyword = trim($_GET['keyword']); } else { extract($opt); } $imodel = new $controllerId(); $item_count = call_user_func(array($imodel, 'count'), $criteria); $page_size = strlen($opt['page_size']) > 0 ? $opt['page_size'] : 10; $pages = new CPagination($item_count); $pages->setPageSize($page_size); $pagination = new CLinkPager(); $pagination->cssFile = false; $pagination->setPages($pages); $pagination->init(); $criteria->limit = $page_size; $criteria->offset = $pages->offset; $select_pagination = new CListPager(); $select_pagination->header = Yii::t('cp', 'Go to:'); $select_pagination->htmlOptions['onchange'] = ""; $select_pagination->setPages($pages); $select_pagination->init(); $list = call_user_func(array($imodel, 'findAll'), $criteria); if (!is_array($opt['tpl_params'])) { $opt['tpl_params'] = array(); } $opt['tpl_params']['list'] = $list; $opt['tpl_params']['pagination'] = $pagination; $opt['tpl_params']['select_pagination'] = $select_pagination; // echo Chtml::listBox('category_id',1,$leafs) //print_r($opt['tpl_params']); if ($is_partial) { $this->renderPartial('_index', $opt['tpl_params'], false, true); } else { $tpl = strlen($opt['tpl']) > 0 ? $opt['tpl'] : 'index'; if ($_GET['ajax'] == 'ajax') { $this->renderPartial($tpl, $opt['tpl_params'], false, true); } else { $this->render($tpl, $opt['tpl_params'], false, true); } } }
public function init() { if ($this->cssFile === null) { $this->cssFile = CHtml::asset(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR . 'pager.css'); } $this->header .= CHtml::openTag('div', array('class' => $this->pagerCssClass)); $this->footer = $this->ajaxProcessTemplate . CHtml::closeTag('div') . $this->footer; parent::init(); }
public function init() { parent::init(); $this->firstPageLabel = Yii::t('app', '<< First'); $this->footer = Yii::t('app', ''); $this->header = Yii::t('app', ''); $this->lastPageLabel = Yii::t('app', 'Last >>'); $this->nextPageLabel = Yii::t('app', 'Next >'); $this->prevPageLabel = Yii::t('app', '< Previous'); }
public function index() { //当前页码 $nowpage = isset($_GET['pageIndex']) ? trim($_GET['pageIndex']) : 1; //审核状态 $auditstatus = isset($_GET['auditstatus']) ? trim($_GET['auditstatus']) : null; $cp = new CommonPRM(); $pageInfo = new PageInfo(); $pageInfo->nowpage = $nowpage; $pageInfo->pagesize = 10; $cp->pageinfo = $pageInfo; $btbSportitemBasePRM = new BtbSportitemBasePRM(); $btbSportitemBasePRM->order_by = ' id DESC '; if (!is_null($auditstatus)) { if (is_numeric($auditstatus)) { //auditstatus不为空赋予查询条件 $btbSportitemBasePRM->auditstatus = $auditstatus; //分页跳转的时候保证查询条件 $urlPrefix = 'SportitemBaseList/index?auditstatus=' . $auditstatus; } } else { $urlPrefix = 'SportitemBaseList/index'; } //获取登录者的信息 $user = $this->getLoginInfo(); $btbSportitemBasePRM->obj_createuser = $user['id']; //echo $user['id']; //exit; //动作库List $sportitemBaseList = BtbSportitemBaseBLL::getSportitemBaseList($cp, $btbSportitemBasePRM); $page = new CLinkPager($pageInfo->totalcount, $pageInfo->pagesize, $urlPrefix); $show = $page->show(); $this->assign('auditstatus', $auditstatus); $this->assign('totalcount', $pageInfo->totalcount); $this->assign('page', $show); $this->assign('sportitemBaseList', $sportitemBaseList); //menu动作库 $this->assign('headtype', 2); //课程管理1还是课程审核页面0 $this->assign('coachtype', $user['type']); //$this->display("SportitemBaseList/index"); $this->display("SportitemBase/index"); }
public function index() { //当前页码 $nowpage = isset($_GET['pageIndex']) ? trim($_GET['pageIndex']) : 1; //审核状态 $status = isset($_GET['status']) ? trim($_GET['status']) : null; $cp = new CommonPRM(); $pageInfo = new PageInfo(); $pageInfo->nowpage = $nowpage; $pageInfo->pagesize = 10; $cp->pageinfo = $pageInfo; $btbTrainingplanBasePRM = new BtbTrainingplanBasePRM(); $btbTrainingplanBasePRM->order_by = ' id DESC '; //不包括未提交0的状态 $btbTrainingplanBasePRM->statusnot = 0; if (!is_null($status)) { if (is_numeric($status)) { //auditstatus不为空赋予查询条件 $btbTrainingplanBasePRM->status = $status; //分页跳转的时候保证查询条件 $urlPrefix = 'TrainingplanBaseCheckList/index?status=' . $status; } } else { $urlPrefix = 'TrainingplanBaseCheckList/index'; } //获取登录者的信息 $user = $this->getLoginInfo(); //课程设计完善List $trainingplanBaseList = BtbTrainingplanBaseBLL::getTrainingplanBaseList($cp, $btbTrainingplanBasePRM); $page = new CLinkPager($pageInfo->totalcount, $pageInfo->pagesize, $urlPrefix); $show = $page->show(); $this->assign('status', $status); $this->assign('totalcount', $pageInfo->totalcount); $this->assign('page', $show); $this->assign('trainingplanBaseList', $trainingplanBaseList); //menu课程设计 $this->assign('headtype', 3); //课程管理1还是课程审核页面0 $this->assign('coachtype', $user['type']); //$this->display("TrainingplanBaseCheckList/index"); $this->display("TrainingplanBaseCheck/index"); }
/** * Override from CBasePager in order to utilize * pagination class which allows for custom * routes during createUrl for pages * @return pagination the default pagination instance. */ public function init() { parent::init(); if (isset($this->paginationParams)) { assert('is_array($this->paginationParams)'); $this->getPages()->params = $this->paginationParams; } if (isset($this->route)) { $this->getPages()->route = $this->route; } }
/** * */ public function init() { parent::init(); $cs = Yii::app()->getClientScript(); $cs->registerCoreScript('jquery'); $assets = dirname(__FILE__) . '/assets/js'; $this->baseUrl = Yii::app()->assetManager->publish($assets); $cs->registerScriptFile($this->baseUrl . '/jquery.iasUp.js', CClientScript::POS_END); $cs->registerScriptFile($this->baseUrl . '/callbacks.js', CClientScript::POS_END); return; }
public function init() { if (!isset($this->htmlOptions['class'])) { $this->htmlOptions['class'] = 'yiiPager myPager'; } if (!in_array($this->pageSize, $this->sizes)) { $this->sizes[$this->pageSize] = $this->pageSize; sort($this->sizes); //Ordena os tamanhos $this->sizes = array_combine($this->sizes, $this->sizes); } $this->header = ''; return parent::init(); }
public function actionPhotos() { $criteria = new CDbCriteria(); $criteria->condition = 'user_id = :user_id'; $criteria->params = array(':user_id' => User()->id); $criteria->order = 'c_time DESC'; if (isset($_GET['keyword'])) { $partial_tpl = '_photos'; } else { $partial_tpl = 'photos'; } $item_count = Attachment::model()->count($criteria); $pages = new CPagination($item_count); $pages->setPageSize($page_size); $pagination = new CLinkPager(); $pagination->cssFile = false; $pagination->setPages($pages); $pagination->init(); $criteria->limit = 6; $criteria->offset = $pages->offset; $select_pagination = new CListPager(); $photos = Attachment::model()->findAll($criteria); $this->renderPartial($partial_tpl, array('photos' => $photos, 'pagination' => $pagination, 'select_pagination' => $select_pagination), false, true); }
public function init() { parent::init(); $assets = dirname(__FILE__) . '/assets'; $this->baseUrl = Yii::app()->assetManager->publish($assets); $cs = Yii::app()->getClientScript(); $cs->registerCoreScript('jquery'); $cs->registerCSSFile($this->baseUrl . '/css/jquery.ias.css'); if (YII_DEBUG) { $cs->registerScriptFile($this->baseUrl . '/js/jquery.ias.js', CClientScript::POS_END); } else { $cs->registerScriptFile($this->baseUrl . '/js/jquery-ias.min.js', CClientScript::POS_END); } return; }
/** * @see CLinkPager::init() */ public function init() { $this->header = ''; if ($this->nextPageLabel === null) { $this->nextPageLabel = '»'; } if ($this->prevPageLabel === null) { $this->prevPageLabel = '«'; } if ($this->firstPageLabel === null) { $this->firstPageLabel = Yii::t('core', 'first'); } if ($this->lastPageLabel === null) { $this->lastPageLabel = Yii::t('core', 'last'); } $this->maxButtonCount = 5; parent::init(); }
/** * Initializes the pager by setting some default property values. */ public function init() { if ($this->nextPageLabel === null) { $this->nextPageLabel = Yii::t('bootstrap', 'Next') . ' →'; } if ($this->prevPageLabel === null) { $this->prevPageLabel = '← ' . Yii::t('bootstrap', 'Previous'); } if ($this->firstPageLabel === null) { $this->firstPageLabel = Yii::t('bootstrap', 'First'); } if ($this->lastPageLabel === null) { $this->lastPageLabel = Yii::t('bootstrap', 'Last'); } if (!isset($this->htmlOptions['class'])) { $this->htmlOptions['class'] = ''; } // would default to yiiPager parent::init(); }
public function actionAPIx() { $item_count = 32; $page_size = 2; $pages = new CPagination($item_count); //$pages->pageVar = 'iook=8&ok'; //$pages->createPageUrl(CController::createUrl('blog/index',$pages) ); $pages->setPageSize($page_size); // simulate the effect of LIMIT in a sql query //$end =($pages->offset+$pages->limit <= $item_count ? $pages->offset+$pages->limit : $item_count); //$sample =range($pages->offset+1, $end); $pagination = new CLinkPager(); //print_r("<pre>"); //print_r($pagination); //print_r("</pre>"); //$pages->pageVar='stat='.$_GET[stat]."&page"; $pagination->setPages($pages); $pagination->init(); $pagination->run(); print_r("--"); print_r($pages->offset); print_r("--"); $pagination = new CListPager(); $pages->pageVar = 'ioof'; $pagination->setPages($pages); $pagination->init(); $pagination->run(); exit; echo 'find id=2 essay <br>'; echo '<pre>'; $a = API::essay(array('id' => '2')); $a->print; echo 'find id=2,3,4 essay <br>'; $a = API::essay(array('id' => ',1,2,3,4,5,6,7,,8,,9,0,0,-,-,,,,r,r,r,w,,3,2,3')); foreach ($a as $t) { print_r("<hr>"); $t->print; } echo '</pre>'; exit; }
/** * Initializes the pager by setting some default property values. */ public function init() { if ($this->nextPageLabel === null) { $this->nextPageLabel = '→'; } if ($this->prevPageLabel === null) { $this->prevPageLabel = '←'; } if ($this->firstPageCssClass === null) { $this->firstPageCssClass = 'first'; } if ($this->previousPageCssClass === null) { $this->previousPageCssClass = 'previous'; } if ($this->internalPageCssClass === null) { $this->internalPageCssClass = 'page'; } if ($this->nextPageCssClass === null) { $this->nextPageCssClass = 'next'; } if ($this->lastPageCssClass === null) { $this->lastPageCssClass = 'last'; } $classes = array(); $validAlignments = array(self::ALIGNMENT_CENTER, self::ALIGNMENT_RIGHT); if (in_array($this->alignment, $validAlignments)) { $classes[] = 'pagination-' . $this->alignment; } if (!empty($classes)) { $classes = implode(' ', $classes); if (isset($this->htmlOptions['class'])) { $this->htmlOptions['class'] = ' ' . $classes; } else { $this->htmlOptions['class'] = $classes; } } parent::init(); }
public function init() { $this->setCurrentUrl($this->currentUrl); $this->currentPage = parent::getCurrentPage(false) + 1; $this->itemCount = parent::getPageCount(); $this->header = Ibos::lang("page_header", "page"); $this->htmlOptions["id"] = Ibos::lang("htmlOptions_id", "page"); $this->htmlOptions["class"] = Ibos::lang("htmlOptions_class", "page"); $this->pervNextHtmlOption["id"] = Ibos::lang("pervNextHtmlOption_id", "page"); $this->pervNextHtmlOption["class"] = Ibos::lang("pervNextHtmlOption_class", "page"); $this->setFooter(); $this->prevPageLabel = Ibos::lang("prevpage_label", "page"); $this->nextPageLabel = Ibos::lang("nextpage_label", "page"); $this->firstPageLabel = Ibos::lang("firstpage_label", "page"); $this->firstPageCssClass = Ibos::lang("firstpage_cssclass", "page"); $this->lastPageLabel = Ibos::lang("lastpage_label", "page"); $this->lastPageCssClass = Ibos::lang("lastpage_cssclass", "page"); $this->hiddenPageCssClass = Ibos::lang("hiddenpage_cssclass", "page"); $this->selectedPageCssClass = Ibos::lang("selected_cssclass", "page"); $this->cssFile = false; $this->previousPageCssClass = "btn btn-small"; $this->nextPageCssClass = "btn btn-small"; }
/** *### .init() * * Initializes the pager by setting some default property values. */ public function init() { if ($this->nextPageLabel === null) { $this->nextPageLabel = '<i class="fa fa-angle-right"></i>'; } if ($this->prevPageLabel === null) { $this->prevPageLabel = '<i class="fa fa-angle-left"></i>'; } $classes = array('pagination'); $validAlignments = array(self::ALIGNMENT_CENTER, self::ALIGNMENT_RIGHT); if (in_array($this->alignment, $validAlignments)) { $classes[] = 'pagination-' . $this->alignment; } if (!empty($classes)) { $classes = implode(' ', $classes); if (isset($this->htmlOptions['class'])) { $this->htmlOptions['class'] = ' ' . $classes; } else { $this->htmlOptions['class'] = $classes; } } parent::init(); }
/** * Override from CBasePager in order to utilize * pagination class which allows for custom * routes during createUrl for pages * @return pagination the default pagination instance. */ public function init() { parent::init(); $this->getPages()->params = $this->paginationParams; $this->getPages()->route = $this->route; }
public function init() { parent::init(); //$this->header = 'Total Pages:' . $this->pageCount; }
public function init() { parent::init(); }
/** *### .init() * * Initializes the pager by setting some default property values. */ public function init() { if ($this->nextPageLabel === null) { $this->nextPageLabel = '»'; } if ($this->prevPageLabel === null) { $this->prevPageLabel = '«'; } $classes = array('pagination'); /* TODO: move these to styles files! */ $style = ''; $containerStyle = ''; $validAlignments = array(self::ALIGNMENT_CENTER, self::ALIGNMENT_RIGHT); if (in_array($this->alignment, $validAlignments)) { if ($this->alignment == self::ALIGNMENT_RIGHT) { $classes[] = 'pull-right'; } if ($this->alignment == self::ALIGNMENT_CENTER) { // $style = 'margin-left: auto; margin-right: auto;'; // not needed! $containerStyle = 'text-align: center;'; } } if (!empty($classes)) { $classes = implode(' ', $classes); if (isset($this->htmlOptions['class'])) { $this->htmlOptions['class'] = ' ' . $classes; } else { $this->htmlOptions['class'] = $classes; } } if (!empty($style)) { if (isset($this->htmlOptions['style']) && !empty($this->htmlOptions['style'])) { $this->htmlOptions['style'] .= ' ' . $style; } else { $this->htmlOptions['style'] = $style; } } if (!empty($containerStyle)) { if (isset($this->containerHtmlOptions['style']) && !empty($this->containerHtmlOptions['style'])) { $this->containerHtmlOptions['style'] .= ' ' . $containerStyle; } else { $this->containerHtmlOptions['style'] = $containerStyle; } } parent::init(); }
public function run() { echo CHtml::openTag('div', array('class' => 'pagination')); parent::run(); echo CHtml::closeTag('div'); }
public function init() { $this->htmlOptions['class'] = "pagination pagination-sm"; //$this->htmlOptions['style'] = "margin: 0;"; parent::init(); }
public function essays($opt = null) { $include = empty($opt['include']) ? false : true; $split = empty($opt['split']) ? false : true; $order = empty($opt['order']) ? ' id DESC ' : $opt['order']; if ($include) { $ids = $this->sub_nodes(); $criteria = new CDbCriteria(); $criteria->condition = 'find_in_set(category_id,:ids)'; $criteria->order = $order; $criteria->params = array(':ids' => $ids); if ($split) { $item_count = Article::model()->count($criteria); $page_size = 2; $pages = new CPagination($item_count); $pages->setPageSize($page_size); $pagination = new CLinkPager(); $pagination->setPages($pages); $pagination->init(); //$pagination->run(); // display the html pagination $criteria->limit = $page_size; $criteria->offset = $pages->offset; $articles = Article::model()->findall($criteria); } else { $articles = Article::model()->findall($criteria); } } else { $articles = $this->articles; } if ($split) { return array($articles, $pagination); } else { return $articles; } }