Class JControllerForm

Description

Controller tailored to suit most form-based admin operations.

  • todo: Add ability to set redirect manually to better cope with frontend usage.
  • since: 12.2

Located in /libraries/legacy/controller/form.php (line 20)

JObject
   |
   --JControllerLegacy
      |
      --JControllerForm
Direct descendents
Class Description
 class AdminControllerProfile User profile controller class.
 class BannersControllerBanner Banner controller class.
 class BannersControllerClient Client controller class.
 class CategoriesControllerCategory The Category Controller
 class ContactControllerContact
 class ContentControllerArticle
 class FinderControllerFilter Indexer controller class for Finder.
 class LanguagesControllerLanguage Languages list actions controller.
 class LanguagesControllerOverride Languages Override Controller
 class MenusControllerItem The Menu Item Controller
 class MenusControllerMenu The Menu Type Controller
 class MessagesControllerMessage Messages Component Message Model
 class ModulesControllerModule Module controller class.
 class NewsfeedsControllerNewsfeed Newsfeed controller class.
 class PluginsControllerPlugin Plugin controller class.
 class RedirectControllerLink Redirect link controller class.
 class TagsControllerTag The Tag Controller
 class TemplatesControllerStyle Template style controller class.
 class UsersControllerGroup User view level controller class.
 class UsersControllerLevel User view level controller class.
 class UsersControllerNote User note controller class.
 class UsersControllerUser User controller class.
 class WeblinksControllerWeblink
Variable Summary
 string $context
 string $option
 string $text_prefix
 string $view_item
 string $view_list
Method Summary
 JControllerForm __construct ([array $config = array()])
 mixed add ()
 boolean allowAdd ([array $data = array()])
 boolean allowEdit ([array $data = array()], [string $key = 'id'])
 boolean allowSave (array $data, [string $key = 'id'])
 boolean batch (JModelLegacy $model)
 boolean cancel ([string $key = null])
 boolean edit ([string $key = null], [string $urlVar = null])
 object The getModel ([string $name = ''], [string $prefix = ''], [array $config = array('ignore_request' => true)])
 string getRedirectToItemAppend ([integer $recordId = null], [string $urlVar = 'id'])
 mixed loadhistory ()
 void postSaveHook (JModelLegacy $model, [array $validData = array()])
 boolean save ([string $key = null], [string $urlVar = null])
Variables
string $context (line 28)

The context for storing internal data, e.g. record.

  • since: 12.2
  • access: protected
string $option (line 36)

The URL option for the component.

  • since: 12.2
  • access: protected
string $text_prefix (line 60)

The prefix to use with controller messages.

  • since: 12.2
  • access: protected

Redefined in descendants as:
string $view_item (line 44)

The URL view item variable.

  • since: 12.2
  • access: protected

Redefined in descendants as:
string $view_list (line 52)

The URL view list variable.

  • since: 12.2
  • access: protected

Redefined in descendants as:

Inherited Variables

Inherited from JControllerLegacy

JControllerLegacy::$basePath
JControllerLegacy::$default_view
JControllerLegacy::$doTask
JControllerLegacy::$input
JControllerLegacy::$instance
JControllerLegacy::$message
JControllerLegacy::$messageType
JControllerLegacy::$methods
JControllerLegacy::$model_prefix
JControllerLegacy::$name
JControllerLegacy::$paths
JControllerLegacy::$redirect
JControllerLegacy::$task
JControllerLegacy::$taskMap

Inherited from JObject

JObject::$_errors
Methods
Constructor __construct (line 71)

Constructor.

JControllerForm __construct ([array $config = array()])
  • array $config: An optional associative array of configuration settings.

Redefinition of:
JControllerLegacy::__construct()
Constructor.

Redefined in descendants as:
add (line 144)

Method to add a new record.

  • return: True if the record can be added, a error object if not.
  • since: 12.2
  • access: public
mixed add ()

Redefined in descendants as:
allowAdd (line 191)

Method to check if you can add a new record.

Extended classes can override this if necessary.

  • since: 12.2
  • access: protected
boolean allowAdd ([array $data = array()])
  • array $data: An array of input data.

Redefined in descendants as:
allowEdit (line 209)

Method to check if you can add a new record.

Extended classes can override this if necessary.

  • since: 12.2
  • access: protected
boolean allowEdit ([array $data = array()], [string $key = 'id'])
  • array $data: An array of input data.
  • string $key: The name of the key for the primary key; default is id.

Redefined in descendants as:
allowSave (line 226)

Method to check if you can save a new or existing record.

Extended classes can override this if necessary.

  • since: 12.2
  • access: protected
boolean allowSave (array $data, [string $key = 'id'])
  • array $data: An array of input data.
  • string $key: The name of the key for the primary key.

Redefined in descendants as:
batch (line 249)

Method to run batch operations.

  • return: True if successful, false otherwise and internal error is set.
  • since: 12.2
  • access: public
boolean batch (JModelLegacy $model)
  • JModelLegacy $model: The model of the component being processed.

Redefined in descendants as:
cancel (line 294)

Method to cancel an edit.

  • return: True if access level checks pass, false otherwise.
  • since: 12.2
  • access: public
boolean cancel ([string $key = null])
  • string $key: The name of the primary key of the URL variable.

Redefined in descendants as:
edit (line 359)

Method to edit an existing record.

  • return: True if access level check and checkout passes, false otherwise.
  • since: 12.2
  • access: public
boolean edit ([string $key = null], [string $urlVar = null])
  • 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).

Redefined in descendants as:
getModel (line 443)

Method to get a model object, loading it if required.

  • return: model.
  • since: 12.2
  • access: public
object The getModel ([string $name = ''], [string $prefix = ''], [array $config = array('ignore_request' => true)])
  • string $name: The model name. Optional.
  • string $prefix: The class prefix. Optional.
  • array $config: Configuration array for model. Optional.

Redefinition of:
JControllerLegacy::getModel()
Method to get a model object, loading it if required.

Redefined in descendants as:
getRedirectToItemAppend (line 463)

Gets the URL arguments to append to an item redirect.

  • return: The arguments to append to the redirect URL.
  • since: 12.2
  • access: protected
string getRedirectToItemAppend ([integer $recordId = null], [string $urlVar = 'id'])
  • integer $recordId: The primary key id for the item.
  • string $urlVar: The name of the URL variable for the id.

Redefined in descendants as:
getRedirectToListAppend (line 495)

Gets the URL arguments to append to a list redirect.

  • return: The arguments to append to the redirect URL.
  • since: 12.2
  • access: protected
string getRedirectToListAppend ()

Redefined in descendants as:
loadhistory (line 531)

Method to load a row from version history

  • return: True if the record can be added, a error object if not.
  • since: 3.2
  • access: public
mixed loadhistory ()
postSaveHook (line 520)

Function that allows child controller access to model data after the data has been saved.

  • since: 12.2
  • access: protected
void postSaveHook (JModelLegacy $model, [array $validData = array()])
  • JModelLegacy $model: The data model object.
  • array $validData: The validated data.

Redefined in descendants as:
save (line 608)

Method to save a record.

  • return: True if successful, false otherwise.
  • since: 12.2
  • access: public
boolean save ([string $key = null], [string $urlVar = null])
  • 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).

Redefined in descendants as:

Inherited Methods

Inherited From JControllerLegacy

 JControllerLegacy::__construct()
 JControllerLegacy::addModelPath()
 JControllerLegacy::addPath()
 JControllerLegacy::addViewPath()
 JControllerLegacy::authorise()
 JControllerLegacy::checkEditId()
 JControllerLegacy::createFileName()
 JControllerLegacy::createModel()
 JControllerLegacy::createView()
 JControllerLegacy::display()
 JControllerLegacy::execute()
 JControllerLegacy::getInstance()
 JControllerLegacy::getModel()
 JControllerLegacy::getName()
 JControllerLegacy::getTask()
 JControllerLegacy::getTasks()
 JControllerLegacy::getView()
 JControllerLegacy::holdEditId()
 JControllerLegacy::redirect()
 JControllerLegacy::registerDefaultTask()
 JControllerLegacy::registerTask()
 JControllerLegacy::releaseEditId()
 JControllerLegacy::setMessage()
 JControllerLegacy::setPath()
 JControllerLegacy::setRedirect()
 JControllerLegacy::unregisterTask()

Inherited From JObject

 JObject::__construct()
 JObject::def()
 JObject::get()
 JObject::getError()
 JObject::getErrors()
 JObject::getProperties()
 JObject::set()
 JObject::setError()
 JObject::setProperties()
 JObject::__toString()

Documentation generated on Tue, 19 Nov 2013 15:03:43 +0100 by phpDocumentor 1.4.3