本文整理汇总了PHP中JModelList::getState方法的典型用法代码示例。如果您正苦于以下问题:PHP JModelList::getState方法的具体用法?PHP JModelList::getState怎么用?PHP JModelList::getState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JModelList
的用法示例。
在下文中一共展示了JModelList::getState方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testPopulateStateReturnsZeroWithoutContext
/**
* Tests the populateState method.
*
* @since 3.4
*
* @return void
*
* @testdox populateState() returns 0 without an applied context
*/
public function testPopulateStateReturnsZeroWithoutContext()
{
$method = new ReflectionMethod('JModelList', 'populateState');
$method->setAccessible(true);
TestReflection::setValue($this->object, 'context', false);
TestReflection::setValue($this->object, '__state_set', true);
$method->invoke($this->object);
$this->assertEquals(0, $this->object->getState('list.start'));
$this->assertEquals(0, $this->object->getState('list.limit'));
}
示例2: getState
function getState($property = null, $default = null)
{
static $set;
if (!$set) {
$folder = JRequest::getVar('folder', '', '', 'path');
$this->setState('folder', $folder);
$parent = str_replace("\\", "/", dirname($folder));
$parent = $parent == '.' ? null : $parent;
$this->setState('parent', $parent);
$set = true;
}
return parent::getState($property, $default);
}
示例3: getState
/**
* Get property value from model state.
*
* @param string $name property name
* @param mixed $default property default value if state is no available
* @return mixed property from model state or default value
*/
public function getState($name = null, $default = null)
{
return parent::getState(JoomDOCView::getStateName($name, $default));
}