本文整理匯總了PHP中JModelList::loadFormData方法的典型用法代碼示例。如果您正苦於以下問題:PHP JModelList::loadFormData方法的具體用法?PHP JModelList::loadFormData怎麽用?PHP JModelList::loadFormData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類JModelList
的用法示例。
在下文中一共展示了JModelList::loadFormData方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: loadFormData
/**
* Overrides the default function to check Date fields format, identified by
* "_dateformat" suffix, and erases the field if it's not correct.
*/
protected function loadFormData()
{
$app = JFactory::getApplication();
$filters = $app->getUserState($this->context . '.filter', array());
$error_dateformat = false;
foreach ($filters as $key => $value) {
if (strpos($key, '_dateformat') && !empty($value) && !$this->isValidDate($value)) {
$filters[$key] = '';
$error_dateformat = true;
}
}
if ($error_dateformat) {
$app->enqueueMessage(JText::_("COM_SOMOSMAESTROS_SEARCH_FILTER_DATE_FORMAT"), "warning");
$app->setUserState($this->context . '.filter', $filters);
}
return parent::loadFormData();
}
示例2: loadFormData
/**
* Method to get the data that should be injected in the form.
*
* @return mixed The data for the form.
*
* @since 3.5
*/
protected function loadFormData()
{
$data = parent::loadFormData();
// Set the selected filter values for pages that use the JLayouts for filtering
$data->list['sortTable'] = $this->state->get('list.ordering');
$data->list['directionTable'] = $this->state->get('list.direction');
return $data;
}