本文整理汇总了PHP中JPagination::get方法的典型用法代码示例。如果您正苦于以下问题:PHP JPagination::get方法的具体用法?PHP JPagination::get怎么用?PHP JPagination::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JPagination
的用法示例。
在下文中一共展示了JPagination::get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Class Constructor.
*
* @since 1.0
* @access public
* @param int The total number of records.
* @param int The number of items shown.
* @param int The number of items to be shown per page.
*/
public function __construct($total, $limitstart, $limit)
{
// Initialize the original pagination from Joomla.
$this->pagination = new JPagination($total, $limitstart, $limit);
if (!FD::isJoomla30()) {
$this->pagination->pagesCurrent = $this->pagination->get('pages.current');
$this->pagination->pagesTotal = $this->pagination->get('pages.total');
$this->pagination->pagesStart = $this->pagination->get('pages.start');
$this->pagination->pagesStop = $this->pagination->get('pages.stop');
}
}
示例2: testConstructor
/**
* This method tests the.
*
* This is a basic data driven test. It takes the data passed, runs the constructor
* and make sure the appropriate values get setup.
*
* @return void
*
* @since 11.1
* @dataProvider dataTestConstructor
* @covers JPagination::__construct
*/
public function testConstructor($total, $limitstart, $limit, $expected)
{
$pagination = new JPagination($total, $limitstart, $limit);
$this->assertEquals($expected['total'], $pagination->total, 'Wrong Total');
$this->assertEquals($expected['limitstart'], $pagination->limitstart, 'Wrong Limitstart');
$this->assertEquals($expected['limit'], $pagination->limit, 'Wrong Limit');
$this->assertEquals($expected['pages.total'], $pagination->get('pages.total'), 'Wrong Total Pages');
$this->assertEquals($expected['pages.current'], $pagination->get('pages.current'), 'Wrong Current Page');
$this->assertEquals($expected['pages.start'], $pagination->get('pages.start'), 'Wrong Start Page');
$this->assertEquals($expected['pages.stop'], $pagination->get('pages.stop'), 'Wrong Stop Page');
unset($pagination);
}
示例3: testGet
/**
* This method tests the get method.
*
* @param integer $property The property to get.
* @param string $default The default value if the property doesn't exist
* @param array $expected The expected results for the JPagination object
*
* @return void
*
* @covers JPagination::get
* @dataProvider dataGet
* @since 3.2
*/
public function testGet($property, $default, $expected)
{
$pagination = new JPagination(100, 50, 20, '', $this->app);
$result = $pagination->get($property, $default);
$this->assertEquals($result, $expected, 'The expected output of the property is incorrect');
unset($pagination);
}