\FOFController
FrameworkOnFramework controller class. FOF is based on the thin controller paradigm, where the controller is mainly used to set up the model state and spawn the view.
Synopsis
class FOFController
extends JObject
{
- // members
- protected $autoRouting;
- protected $bareComponent;
- protected $basePath;
- protected $cacheableTasks;
- protected $component;
- protected $config;
- protected FOFConfigProvider $configProvider;
- protected $csrfProtection;
- protected $default_view;
- protected $doTask;
- protected FOFInput $input;
- protected $message;
- protected $messageType;
- protected $layout;
- protected $methods;
- protected $model_prefix;
- protected $modelName;
- protected $paths;
- protected $redirect;
- protected $task;
- protected $taskMap;
- protected $name;
- protected $view;
- protected $viewName;
- private FOFView $_viewObject;
- protected $viewsCache;
- private FOFModel $_modelObject;
- protected $hasForm;
- // Inherited members from JObject
- protected $_errors;
- // methods
- public static FOFController getAnInstance()
- public static FOFController getTmpInstance()
- public void __construct()
- public static void addModelPath()
- protected FOFController addPath()
- public FOFController addViewPath()
- public boolean authorise()
- protected static string createFileName()
- public null|bool execute()
- public bool display()
- public boolean browse()
- public bool read()
- public false|void add()
- public bool edit()
- public bool apply()
- public bool copy()
- public bool save()
- public bool savenew()
- public bool cancel()
- public bool accesspublic()
- public bool accessregistered()
- public bool accessspecial()
- public bool publish()
- public bool unpublish()
- public bool archive()
- public bool trash()
- public bool saveorder()
- public bool orderdown()
- public bool orderup()
- public bool remove()
- public boolean redirect()
- public boolean hasRedirect()
- public FOFController registerDefaultTask()
- public FOFController registerTask()
- public FOFController unregisterTask()
- public string setMessage()
- protected void setPath()
- public FOFController setRedirect()
- protected final bool setstate()
- protected final bool setaccess()
- protected final boolean applySave()
- public final FOFModel getThisModel()
- public getModel()
- public final FOFView getThisView()
- public string getName()
- public string getTask()
- public array getTasks()
- public FOFView getView()
- protected FOFModel createModel()
- protected mixed _createModel()
- protected FOFView createView()
- protected FOFView _createView()
- public void setThisViewName()
- public void setThisModelName()
- protected boolean checkACL()
- protected boolean onBeforeGenericTask()
- protected boolean onBeforeApplySave()
- protected boolean onAfterApplySave()
- protected boolean onBeforeAccesspublic()
- protected boolean onBeforeAccessregistered()
- protected boolean onBeforeAccessspecial()
- protected boolean onBeforeAdd()
- protected boolean onBeforeApply()
- protected boolean onBeforeBrowse()
- protected boolean onBeforeCancel()
- protected boolean onBeforeEdit()
- protected boolean onBeforeOrderdown()
- protected boolean onBeforeOrderup()
- protected boolean onBeforePublish()
- protected boolean onBeforeRemove()
- protected boolean onBeforeSave()
- protected boolean onBeforeSavenew()
- protected boolean onBeforeSaveorder()
- protected boolean onBeforeUnpublish()
- public string getItemidURLSuffix()
- protected boolean _csrfProtection()
- // Inherited methods from JObject
- public void __construct()
- public string __toString()
- public mixed def()
- public mixed get()
- public array getProperties()
- public string getError()
- public array getErrors()
- public mixed set()
- public boolean setProperties()
- public void setError()
Hierarchy
Members
private
- $_modelObject
—
FOFModel
A copy of the FOFModel object used in this triad - $_viewObject
—
FOFView
A copy of the FOFView object used in this triad
protected
- $_errors
—
array
An array of error messages or Exception objects. - $autoRouting — int
- $bareComponent
—
string
The current component's name without the com_ prefix - $basePath
—
string
The base path of the controller - $cacheableTasks
—
array
The tasks for which caching should be enabled by default - $component
—
string
The current component's name; you can override it in the configuration - $config
—
array
A cached copy of the class configuration parameter passed during initialisation - $configProvider
—
FOFConfigProvider
An instance of FOFConfigProvider to provision configuration overrides - $csrfProtection
—
integer
Set to true to enable CSRF protection on selected tasks. The possible values are: 0 Disabled; no token checks are performed 1 Enabled; token checks are always performed 2 Only on HTML requests and backend; token checks are always performed in the back-end and in the front-end only when format is 'html' 3 Only on back-end; token checks are performer only in the back-end - $default_view
—
string
The default view for the display method. - $doTask
—
string
The mapped task that was performed. - $hasForm
—
boolean
Does this tried have a FOFForm which will be used to render it? - $input
—
FOFInput
The input object for this MVC triad; you can override it in the configuration - $layout
—
string
The current layout; you can override it in the configuration - $message
—
string
Redirect message. - $messageType
—
string
Redirect message type. - $methods
—
array
Array of class methods - $modelName
—
string
Overrides the name of the view's default model - $model_prefix
—
string
The prefix of the models - $name
—
array
The name of the controller - $paths
—
array
The set of search directories for resources (views). - $redirect
—
string
URL for redirection. - $task
—
string
Current or most recently performed task. - $taskMap
—
array
Array of class methods to call for a given task. - $view
—
string
The current view name; you can override it in the configuration - $viewName
—
string
Overrides the name of the view's default view - $viewsCache
—
array
A cache for the view item objects created in this controller
Methods
protected
- _createModel() — Method to load and return a model object.
- _createView() — Deprecated function to create a View object instance
- _csrfProtection() — Applies CSRF protection by means of a standard Joomla! token (nonce) check.
- addPath() — Adds to the search path for templates and resources.
- applySave() — Common method to handle apply and save tasks
- checkACL() — Checks if the current user has enough privileges for the requested ACL area.
- createFileName() — Create the filename for a resource.
- createModel() — Creates a new model object
- createView() — Creates a View object instance and returns it
- onAfterApplySave() — Execute something after applySave has run.
- onBeforeAccesspublic() — ACL check before changing the access level; override to customise
- onBeforeAccessregistered() — ACL check before changing the access level; override to customise
- onBeforeAccessspecial() — ACL check before changing the access level; override to customise
- onBeforeAdd() — ACL check before adding a new record; override to customise
- onBeforeApply() — ACL check before saving a new/modified record; override to customise
- onBeforeApplySave() — Execute something before applySave is called. Return false to prevent applySave from executing.
- onBeforeBrowse() — ACL check before allowing someone to browse
- onBeforeCancel() — ACL check before cancelling an edit
- onBeforeEdit() — ACL check before editing a record; override to customise
- onBeforeGenericTask() — A catch-all method for all tasks without a corresponding onBefore method. Applies the ACL preferences defined in fof.xml.
- onBeforeOrderdown() — ACL check before changing the ordering of a record; override to customise
- onBeforeOrderup() — ACL check before changing the ordering of a record; override to customise
- onBeforePublish() — ACL check before changing the publish status of a record; override to customise
- onBeforeRemove() — ACL check before removing a record; override to customise
- onBeforeSave() — ACL check before saving a new/modified record; override to customise
- onBeforeSavenew() — ACL check before saving a new/modified record; override to customise
- onBeforeSaveorder() — ACL check before changing the ordering of a record; override to customise
- onBeforeUnpublish() — ACL check before changing the publish status of a record; override to customise
- setPath() — Sets an entire array of search paths for resources.
- setaccess() — Sets the access level of the selected item(s).
- setstate() — Sets the published state (the enabled field) of the selected item(s)
public
- __construct() — Public constructor of the Controller class
- accesspublic() — Sets the access to public. Joomla! 1.5 compatibility.
- accessregistered() — Sets the access to registered. Joomla! 1.5 compatibility.
- accessspecial() — Sets the access to special. Joomla! 1.5 compatibility.
- add() — Single record add. The form layout is used to present a blank page.
- addModelPath() — Adds to the stack of model paths in LIFO order.
- addViewPath() — Add one or more view paths to the controller's stack, in LIFO order.
- apply() — Save the incoming data and then return to the Edit task
- archive() — Archive (set enabled = 2) an item.
- browse() — Implements a default browse task, i.e. read a bunch of records and send them to the browser.
- cancel() — Cancel the edit, check in the record and return to the Browse task
- copy() — Duplicates selected items
- display() — Default task. Assigns a model to the view and asks the view to render itself.
- edit() — Single record edit. The ID set in the request is passed to the model, then the form layout is used to edit the result.
- execute() — Executes a given controller task. The onBefore<task> and onAfter<task> methods are called automatically if they exist.
- getAnInstance() — Gets a static (Singleton) instance of a controller class. It loads the relevant controller file from the component's directory or, if it doesn't exist, creates a new controller object out of thin air.
- getItemidURLSuffix() — Gets a URL suffix with the Itemid parameter. If it's not the front-end of the site, or if there is no Itemid set it returns an empty string.
- getModel() — Method to get a model object, loading it if required.
- getName() — Method to get the controller name
- getTask() — Get the last task that is being performed or was most recently performed.
- getTasks() — Gets the available tasks in the controller.
- getThisModel() — Returns the default model associated with the current view
- getThisView() — Returns current view object
- getTmpInstance() — Gets a temporary instance of a controller object. A temporary instance is not a Singleton and can be disposed off after use.
- getView() — Method to get a reference to the current view and load it if necessary.
- hasRedirect() — Returns true if there is a redirect set in the controller
- orderdown() — Moves selected items one position down the ordering list
- orderup() — Moves selected items one position up the ordering list
- publish() — Publish (set enabled = 1) an item.
- read() — Single record read. The id set in the request is passed to the model and then the item layout is used to render the result.
- redirect() — Redirects the browser or returns false if no redirect is set.
- registerDefaultTask() — Register the default task to perform if a mapping is not found.
- registerTask() — Register (map) a task to a method in the class.
- remove() — Delete selected item(s)
- save() — Save the incoming data and then return to the Browse task
- savenew() — Save the incoming data and then return to the Add task
- saveorder() — Saves the order of the items
- setMessage() — Sets the internal message that is passed with a redirect
- setRedirect() — Registers a redirection with an optional message. The redirection is carried out when you use the redirect method.
- setThisModelName() — Set the name of the model to be used by this Controller
- setThisViewName() — Set the name of the view to be used by this Controller
- trash() — Trash (set enabled = -2) an item.
- unpublish() — Unpublish (set enabled = 0) an item.
- unregisterTask() — Unregister (unmap) a task in the class.
Inherited from JObject
public
- __toString() — Magic method to convert the object to a string gracefully.
- def() — Sets a default value if not alreay assigned
- get() — Returns a property of the object or the default value if the property is not set.
- getError() — Get the most recent error message.
- getErrors() — Return all errors, if any.
- getProperties() — Returns an associative array of object properties.
- set() — Modifies a property of the object, creating it if it does not already exist.
- setError() — Add an error message.
- setProperties() — Set the object properties based on a named array/hash.