本文整理汇总了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;
}