Class Controller
This class is extended by the various controllers, and makes available methods that allow controllers to interact with views, models, components, helpers, and plugins.
Direct known subclasses
Indirect known subclasses
_404
,
AdminBilling
,
AdminCompanyGeneral
,
AdminCompanyGroups
,
AdminCompanyModules
,
AdminCompanyPlugins
,
AdminCompanyTaxes
,
AdminDialog
,
AdminLicense
,
AdminLogin
,
AdminLogout
,
AdminMain
,
AdminClient
,
AdminMyinfo
,
AdminPackages
,
AdminSearch
,
AdminSettings
,
AdminSystemApi
,
AdminSystemAutomation
,
AdminSystemBackup
,
AdminSystemCompanies
,
AdminSystemGeneral
,
AdminSystemHelp
,
AdminClients
,
AdminSystemMarketplace
,
AdminSystemStaff
,
AdminSystemThemes
,
AdminSystemUpgrade
,
AdminTest
,
AdminTests
,
AdminTheme
,
AdminTools
,
Api
,
Callback
,
AdminCompanyAutomation
,
ClientAccounts
,
ClientContacts
,
ClientDialog
,
ClientInvoices
,
ClientLogin
,
ClientLogout
,
ClientMain
,
ClientPay
,
ClientServices
,
ClientTheme
,
AdminCompanyBilling
,
ClientTransactions
,
Cron
,
Main
,
Upgrade
,
Uploads
,
AdminCompanyCurrencies
,
AdminCompanyCustomfields
,
AdminCompanyEmails
,
AdminCompanyGateways
Methods summary
public
|
|
final protected
|
|
final protected
|
|
final protected
|
#
helpers( array $helpers )
Load the given helpers into this controller, making them available to any implicitly initialized Views, including Controller::$structure |
public
|
|
public
|
#
preAction( )
Overwritable method called before the index method, or controller specified action. This method is public to make compatible with PHP 5.1 (due to a bug not fixed until 5.2). It is, however, not a callable action. |
public
|
#
postAction( )
Overwritable method called after the index method, or controller specified action This method is public to make compatible with PHP 5.1 (due to a bug not fixed until 5.2). It is, however, not a callable action. |
final protected
|
|
final protected
|
#
draw( string $file = null, string $view = null )
Prints the given template file from the given view. |
final protected
string
|
#
partial( string $file, array $params = null, string $view = null )
Returns the given template file using the supplied params from the given view. |
final protected
boolean
|
|
final protected
|
#
stopCaching( )
Stops caching for the current request. If invoked, caching will not be performed for this request. |
final protected
|
#
clearCache( mixed $uri = false )
Clears the cache file for the given URI, or for the curren request if no URI is given |
final protected
|
|
final protected
|
#
render( string $file = null, string $view = null )
Renders the view with its structure (if set). The view is set into the structure as $content. This method can only be called once, since it includes the structure when outputting. To render a partial view use Controller::partial() |
final protected static
|
#
redirect( string $uri = WEBDIR )
Initiates a header redirect to the given URI/URL. Automatically prepends WEBDIR to $uri if $uri is relative (e.g. does not start with a '/' and is not a url) |
final protected
|
#
setDefaultViewPath( string $path )
Sets the default view path for this view and its structure view |
Magic methods summary
Properties summary
public
object
|
$structure |
#
The structure View for this instance |
public
string
|
$structure_view |
#
Name of the structure view file (overwritable by the controller) |
public
object
|
$view |
#
The main View for this instance |
public
array
|
$uri |
#
All parts of the Routed URI |
public
string
|
$uri_str |
#
Requested URI after being Routed |
public
array
|
$get |
#
All GET parameters |
public
array
|
$post |
#
All POST data |
public
array
|
$files |
#
All FILE data |
public
string
|
$plugin |
#
Name of the plugin invoked by this request (if any) |
public
string
|
$controller |
#
Name of the controller invoked by this request |
public
string
|
$action |
#
Action invoked by this request |
public
boolean
|
$is_cli |
#
Flag whether this is a CLI request |
protected
array
|
$uses |
#
Names of all Models this Controller uses |
protected
array
|
$components |
#
Names of all Components this Controller uses |
protected
array
|
$helpers |
#
Names of all Helpers this Controller and child Views use |
private
boolean
|
$rendered |
#
Flag used to determine if the view has been rendered. Controller::render() may only be called once |
private
mixed
|
$cache_for |
#
Amount of time in seconds to cache the current request, null otherwise |