本文整理匯總了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));
}