Back to Joomla project (class list)

Class FormController - list of methods

Controller tailored to suit most form-based admin operations.

Extends

Extends

Package: Joomla\CMS\MVC\Controller
Copyright: (C) 2009 Open Source Matters, Inc.
License: GNU General Public License version 2 or later; see LICENSE.txt
Located at: Joomla/MVC/Controller/FormController.php
Project: Joomla

Method Summary

public
(mixed $config = array(), \Joomla\CMS\MVC\Factory\MVCFactoryInterface $factory = null, ?\Joomla\CMS\Application\CMSApplication $app = null, ?\Joomla\Input\Input $input = null, \Joomla\CMS\Form\FormFactoryInterface $formFactory = null)

Constructor.
Parameters
  • array $config An optional associative array of configuration settings. Recognized key values include 'name', 'default_task', 'model_path', and 'view_path' (this list is not meant to be comprehensive).
  • \Joomla\CMS\MVC\Factory\MVCFactoryInterface $factory The factory.
  • \Joomla\CMS\Application\CMSApplication $app The Application for the dispatcher
  • \Joomla\Input\Input $input Input
  • \Joomla\CMS\Form\FormFactoryInterface $formFactory The form factory.
Since
  • 3.0
Show source code of this method: __construct Source Code

public bool
()

Method to add a new record.
Returns
  • bool True if the record can be added, false if not.
Since
  • 1.6
Show source code of this method: add Source Code

protected bool
(mixed $data = array())

Method to check if you can add a new record.
Parameters
  • array $data An array of input data.
Returns
  • bool
Since
  • 1.6
Show source code of this method: allowAdd Source Code

protected bool
(mixed $data = array(), mixed $key = 'id')

Method to check if you can edit an existing record.
Parameters
  • array $data An array of input data.
  • string $key The name of the key for the primary key; default is id.
Returns
  • bool
Since
  • 1.6
Show source code of this method: allowEdit Source Code

protected bool
(mixed $data, mixed $key = 'id')

Method to check if you can save a new or existing record.
Parameters
  • array $data An array of input data.
  • string $key The name of the key for the primary key.
Returns
  • bool
Since
  • 1.6
Show source code of this method: allowSave Source Code

public bool
(mixed $model)

Method to run batch operations.
Parameters
  • \Joomla\CMS\MVC\Model\BaseDatabaseModel $model The model of the component being processed.
Returns
  • bool True if successful, false otherwise and internal error is set.
Since
  • 1.7
Show source code of this method: batch Source Code

public bool
(mixed $key = null)

Method to cancel an edit.
Parameters
  • string $key The name of the primary key of the URL variable.
Returns
  • bool True if access level checks pass, false otherwise.
Since
  • 1.6
Show source code of this method: cancel Source Code

public bool
(mixed $key = null, mixed $urlVar = null)

Method to edit an existing record.
Parameters
  • string $key The name of the primary key of the URL variable.
  • string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions).
Returns
  • bool True if access level check and checkout passes, false otherwise.
Since
  • 1.6
Show source code of this method: edit Source Code

public \Joomla\CMS\MVC\Model\BaseDatabaseModel
(mixed $name = '', mixed $prefix = '', mixed $config = array('ignore_request' => true))

Method to get a model object, loading it if required.
Parameters
  • string $name The model name. Optional.
  • string $prefix The class prefix. Optional.
  • array $config Configuration array for model. Optional.
Returns
  • \Joomla\CMS\MVC\Model\BaseDatabaseModel The model.
Since
  • 1.6
Show source code of this method: getModel Source Code

protected string
(mixed $recordId = null, mixed $urlVar = 'id')

Gets the URL arguments to append to an item redirect.
Parameters
  • int $recordId The primary key id for the item.
  • string $urlVar The name of the URL variable for the id.
Returns
  • string The arguments to append to the redirect URL.
Since
  • 1.6
Show source code of this method: getRedirectToItemAppend Source Code

protected string
()

Gets the URL arguments to append to a list redirect.
Returns
  • string The arguments to append to the redirect URL.
Since
  • 1.6
Show source code of this method: getRedirectToListAppend Source Code

protected void
(\Joomla\CMS\MVC\Model\BaseDatabaseModel $model, mixed $validData = array())

Function that allows child controller access to model data after the data has been saved.
Parameters
  • \Joomla\CMS\MVC\Model\BaseDatabaseModel $model The data model object.
  • array $validData The validated data.
Returns
  • void
Since
  • 1.6
Show source code of this method: postSaveHook Source Code

public bool
(mixed $key = null, mixed $urlVar = null)

Method to save a record.
Parameters
  • string $key The name of the primary key of the URL variable.
  • string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions).
Returns
  • bool True if successful, false otherwise.
Since
  • 1.6
Show source code of this method: save Source Code

public void
(mixed $key = null, mixed $urlVar = null)

Method to reload a record.
Parameters
  • string $key The name of the primary key of the URL variable.
  • string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions).
Returns
  • void
Since
  • 3.7.4
Show source code of this method: reload Source Code

public void
()

Load item to edit associations in com_associations
Returns
  • void
Since
  • 3.9.0
Deprecated
  • 5.0
Show source code of this method: editAssociations Source Code

Properties Summary

protected string
$context
The context for storing internal data, e.g. record.
Since
  • 1.6
protected string
$option
The URL option for the component.
Since
  • 1.6
protected string
$view_item
The URL view item variable.
Since
  • 1.6
protected string
$view_list
The URL view list variable.
Since
  • 1.6
protected string
$text_prefix
The prefix to use with controller messages.
Since
  • 1.6

Tags Summary

Since
1.6