Blesta
  • Package
  • Class
  • Tree
  • Deprecated

Packages

  • blesta
    • app
      • controllers
      • models
    • components
      • areyouahuman
      • auth
        • motp
        • oath
      • delivery
        • interfax
        • postal
          • methods
      • download
      • email
      • events
        • default
      • exchange
        • rates
          • google
            • finance
          • yahoo
            • finance
      • gateway
        • payments
      • gateways
      • invoice
        • delivery
        • templates
          • quickbooks
            • invoice
      • json
      • modules
      • net
        • amazon
          • s3
        • http
        • net
          • geo
            • ip
      • plugins
      • recaptcha
      • reports
        • aging
          • invoices
        • custom
          • report
        • invoice
          • creation
        • tax
          • liability
        • transactions
          • applied
          • received
      • security
      • session
        • cart
      • settingscollection
      • upgrades
        • tasks
      • upload
      • vcard
    • helpers
      • currency
        • format
      • data
        • structure
          • array
          • string
      • text
        • parser
      • widget
        • client
  • minPHP
    • components
      • input
      • record
    • helpers
      • color
      • data
        • structure
      • date
      • form
      • html
      • javascript
      • xml
    • lib
  • None
  • PHP

Classes

  • Cache
  • Configure
  • Controller
  • Dispatcher
  • Language
  • Loader
  • Model
  • Router
  • View

Exceptions

  • UnknownException

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

AppController, Dispatcher, Install

Indirect known subclasses

_404, AdminBilling, AdminCompanyGeneral, AdminCompanyGroups, AdminCompanyLookandfeel, AdminCompanyModules, AdminCompanyPlugins, AdminCompanyTaxes, AdminCompanyThemes, AdminController, AdminDialog, AdminLicense, AdminClients, AdminLogin, AdminLogout, AdminMyinfo, AdminPackageOptions, AdminPackages, AdminReports, AdminReportsCustomize, AdminSearch, AdminSettings, AdminSystemApi, AdminClientsService, AdminSystemAutomation, AdminSystemBackup, AdminSystemCompanies, AdminSystemGeneral, AdminSystemHelp, AdminSystemMarketplace, AdminSystemStaff, AdminSystemUpgrade, AdminTest, AdminTests, AdminCompanyAutomation, AdminTheme, AdminTools, AdminUpgrade, Api, Callback, ClientAccounts, ClientContacts, ClientController, ClientDialog, ClientInvoices, AdminCompanyBilling, ClientLogin, ClientLogout, ClientMaintenance, ClientPay, ClientServices, ClientTheme, ClientTransactions, Cron, Uploads, AdminCompanyCurrencies, AdminCompanyCustomfields, AdminCompanyEmails, AdminCompanyGateways

Package: minPHP\lib
Located at lib/controller.php

Methods summary

public
# __construct( )

Constructs a new Controller object

Constructs a new Controller object

final protected
# uses( array $models )

Load the given models into this controller

Load the given models into this controller

Parameters

$models
array
$models All models to load
final protected
# components( array $components )

Load the given components into this controller

Load the given components into this controller

Parameters

$components
array
$components All components to load
final protected
# helpers( array $helpers )

Load the given helpers into this controller, making them available to any implicitly initialized Views, including Controller::$structure

Load the given helpers into this controller, making them available to any implicitly initialized Views, including Controller::$structure

Parameters

$helpers
array
$helpers All helpers to load
public
# index( )

The default action method, overwritable.

The default action method, overwritable.

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.

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.

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
# set( mixed $name, mixed $value = null )

Invokes View::set() on $this->view

Invokes View::set() on $this->view

Parameters

$name
mixed
$name The name of the variable to set in this view
$value
mixed
$value The value to assign to the variable set in this view

See

View::set()
final protected
# draw( string $file = null, string $view = null )

Prints the given template file from the given view.

Prints the given template file from the given view.

This method is only useful for including a static view in another view. For setting variables in views, or for setting multiple views in a single Page (e.g. partials) see Controller::partial()

Parameters

$file
string
$file The template file to print
$view
string
$view The view directory to use (null is default)

See

Controller::partial()
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.

Returns the given template file using the supplied params from the given view.

Parameters

$file
string
$file The template file to render
$params
array
$params An array of parameters to set in the template
$view
string
$view The view to find the given template file in

Returns

string
The rendered template
final protected boolean
# startCaching( mixed $time )

Starts caching for the current request

Starts caching for the current request

Parameters

$time
mixed
$time The amount of time to cache for, either an integer (seconds) or a proper strtotime string (e.g. "1 hour").

Returns

boolean
True if caching is enabled, false otherwise.
final protected
# stopCaching( )

Stops caching for the current request. If invoked, caching will not be performed for this request.

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

Clears the cache file for the given URI, or for the curren request if no URI is given

Parameters

$uri
mixed
$uri The request to clear, if not given or false the current request is cleared
final protected
# emptyCache( )

Empties the entire cache of all files (directories excluded)

Empties the entire cache of all files (directories excluded)

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()

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()

Parameters

$file
string
$file The template file to render
$view
string
$view The view directory to look in for the template file.

See

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)

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)

Parameters

$uri
string
$uri The URI or URL to redirect to. Default is WEBDIR
final protected
# setDefaultViewPath( string $path )

Sets the default view path for this view and its structure view

Sets the default view path for this view and its structure view

Parameters

$path
string
$path The view path to replace the current view path

Magic methods summary

Properties summary

public object $structure
#

The structure View for this instance

The structure View for this instance

public string $structure_view
#

Name of the structure view file (overwritable by the controller)

Name of the structure view file (overwritable by the controller)

public object $view
#

The main View for this instance

The main View for this instance

public array $uri
#

All parts of the Routed URI

All parts of the Routed URI

public string $uri_str
#

Requested URI after being Routed

Requested URI after being Routed

public array $get
#

All GET parameters

All GET parameters

public array $post
#

All POST data

All POST data

public array $files
#

All FILE data

All FILE data

public string $plugin
#

Name of the plugin invoked by this request (if any)

Name of the plugin invoked by this request (if any)

public string $controller
#

Name of the controller invoked by this request

Name of the controller invoked by this request

public string $action
#

Action invoked by this request

Action invoked by this request

public boolean $is_cli
#

Flag whether this is a CLI request

Flag whether this is a CLI request

protected array $uses
#

Names of all Models this Controller uses

Names of all Models this Controller uses

protected array $components
#

Names of all Components this Controller uses

Names of all Components this Controller uses

protected array $helpers
#

Names of all Helpers this Controller and child Views use

Names of all Helpers this Controller and child Views use

Blesta API documentation generated by ApiGen 2.8.0