public function build(array $data = array())
    {
        $data += array(
            'page' => 1,
            'limit' => 0,
            'total' => 0,
            'mini' => false,
            'max_pages' => 10,
            'query' => array()
        );

        $this->setPage($data['page'])
            ->setPerPage($data['limit'])
            ->setTotal($data['total'])
            ->setMaxPages($data['max_pages'])
            ->setUrlPattern('?' . urldecode(http_build_query($data['query'])));

        return $this;
    }
public function build(array $data = array())
    {
        $data += array(
            'page' => 1,
            'limit' => 0,
            'total' => 0,
            'mini' => false,
            'max_pages' => 10,
            'query' => array()
        );

        $this->setPage($data['page'])
            ->setPerPage($data['limit'])
            ->setTotal($data['total'])
            ->setMaxPages($data['max_pages'])
            ->setUrlPattern('?' . urldecode(http_build_query($data['query'])));

        return $this;
    }
public function build ( array $ data = array ( ) ) { $ data += array ( 'page' => 1 , 'limit' => 0 , 'total' => 0 , 'mini' => false , 'max_pages' => 10 , 'query' => array ( ) ) ; $ this -> setPage ( $ data [ 'page' ] ) -> setPerPage ( $ data [ 'limit' ] ) -> setTotal ( $ data [ 'total' ] ) -> setMaxPages ( $ data [ 'max_pages' ] ) -> setUrlPattern ( '?' . urldecode ( http_build_query ( $ data [ 'query' ] ) ) ) ; return $ this ; }
Set up pager from an array of parameters
@param array $data
@return $this
Set up pager from an array of parameters