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: 11.1

Located in /libraries/joomla/application/component/controllerform.php (line 22)

JObject
   |
   --JController
      |
      --JControllerForm
Direct descendents
Class Description
WeblinksControllerWeblink Weblink controller class.
ContactControllerContact
ContentControllerArticle
AdminControllerProfile User profile controller class.
ModulesControllerModule Module controller class.
MessagesControllerMessage Messages Component Message Model
UsersControllerUser User controller class.
UsersControllerNote User note controller class.
UsersControllerGroup User view level controller class.
UsersControllerLevel User view level controller class.
NewsfeedsControllerNewsfeed Newsfeed controller class.
LanguagesControllerLanguage Languages list actions controller.
LanguagesControllerOverride Languages Override Controller
PluginsControllerPlugin Plugin controller class.
CategoriesControllerCategory The Category Controller
RedirectControllerLink Redirect link controller class.
TemplatesControllerStyle Template style controller class.
FinderControllerFilter Indexer controller class for Finder.
MenusControllerMenu The Menu Type Controller
MenusControllerItem The Menu Item Controller
BannersControllerClient Client controller class.
BannersControllerBanner Banner controller class.
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 (JModel $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'])
void postSaveHook (JModel &$model, [array $validData = array()])
boolean save ([string $key = null], [string $urlVar = null])
Variables
string $context (line 30)

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

  • since: 11.1
  • access: protected
string $option (line 38)

The URL option for the component.

  • since: 11.1
  • access: protected
string $text_prefix (line 62)

The prefix to use with controller messages.

  • since: 11.1
  • access: protected

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

The URL view item variable.

  • since: 11.1
  • access: protected
string $view_list (line 54)

The URL view list variable.

  • since: 11.1
  • access: protected

Inherited Variables

Inherited from JController

JController::$basePath
JController::$default_view
JController::$doTask
JController::$instance
JController::$message
JController::$messageType
JController::$methods
JController::$model_prefix
JController::$name
JController::$paths
JController::$redirect
JController::$task
JController::$taskMap
JController::$_acoSection
JController::$_acoSectionValue

Inherited from JObject

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

Constructor.

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

Redefinition of:
JController::__construct()
Constructor.

Redefined in descendants as:
add (line 145)

Method to add a new record.

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

Redefined in descendants as:
allowAdd (line 193)

Method to check if you can add a new record.

Extended classes can override this if necessary.

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

Redefined in descendants as:
allowEdit (line 211)

Method to check if you can add a new record.

Extended classes can override this if necessary.

  • since: 11.1
  • 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 228)

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

Extended classes can override this if necessary.

  • since: 11.1
  • 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 252)

Method to run batch operations.

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

Redefined in descendants as:
cancel (line 298)

Method to cancel an edit.

  • return: True if access level checks pass, false otherwise.
  • since: 11.1
  • 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 381)

Method to edit an existing record.

  • return: True if access level check and checkout passes, false otherwise.
  • since: 11.1
  • 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 466)

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

  • return: model.
  • since: 11.1
  • 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:
JController::getModel()
Method to get a model object, loading it if required.
getRedirectToItemAppend (line 486)

Gets the URL arguments to append to an item redirect.

  • return: The arguments to append to the redirect URL.
  • since: 11.1
  • 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 518)

Gets the URL arguments to append to a list redirect.

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

Redefined in descendants as:
postSaveHook (line 543)

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

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

Redefined in descendants as:
save (line 557)

Method to save a record.

  • return: True if successful, false otherwise.
  • since: 11.1
  • 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 JController

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

Inherited From JObject

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

Documentation generated on Mon, 25 Jun 2012 13:53:54 -0500 by phpDocumentor 1.4.4