Back to ListModel class

Method loadFormData

protected mixed
loadFormData
()
Method to get the data that should be injected in the form.
Returns
  • mixed The data for the form.
Since
  • 3.2
Class: ListModel
Project: Joomla

Method loadFormData - Source code

/**
 * Method to get the data that should be injected in the form.
 *
 * @return	mixed	The data for the form.
 *
 * @since	3.2
 */
protected function loadFormData()
{
    // Check the session for previously entered form data.
    $data = Factory::getApplication()->getUserState($this->context, new \stdClass());
    // Pre-fill the list options
    if (!property_exists($data, 'list')) {
        $data->list = array('direction' => $this->getState('list.direction'), 'limit' => $this->getState('list.limit'), 'ordering' => $this->getState('list.ordering'), 'start' => $this->getState('list.start'));
    }
    return $data;
}