Ejemplo n.º 1
0
 /**
  * Creates a page button.
  * You may override this method to customize the page buttons.
  * @param string $label the text label for the button
  * @param integer $page the page number
  * @param string $class the CSS class for the page button.
  * @param boolean $hidden whether this page button is visible
  * @param boolean $selected whether this page button is selected
  * @return string the generated button
  */
 protected function createPageButton($label, $page, $selected)
 {
     $url = Yii::app()->createUrl(getCurrentRoute(), array_merge($_GET, $this->searchParams ? $this->searchParams : array(), array('page' => $page + 1)));
     if ($this->jsCallback) {
         $currentPage = $page + 1;
         $a = "<a href='javascript:{$this->jsCallback}({$currentPage})'>{$label}</a>";
     } else {
         $a = "<a href='{$url}'>{$label}</a>";
     }
     if ($selected) {
         return "<li class='active'><a href='javascript:void(0)'>{$label}</a></li>";
     }
     return "<li>{$a}</li>";
 }
Ejemplo n.º 2
0
function getCurrentUrl($param = array())
{
    return Yii::app()->createUrl(getCurrentRoute(), $param);
}