Hawk - PHP documentation
  • Namespace
  • Class
  • Tree

Namespaces

  • Hawk
    • View
      • Plugins

Classes

  • App
  • ButtonInput
  • Cache
  • CheckboxInput
  • ColorInput
  • Conf
  • Controller
  • Crypto
  • DatabaseSessionHandler
  • DatetimeInput
  • DB
  • DBExample
  • DeleteInput
  • Dialogbox
  • EmailInput
  • ErrorHandler
  • Event
  • FileInput
  • FileSystem
  • FloatInput
  • Form
  • FormFieldset
  • FormInput
  • GenericModel
  • GifImage
  • HawkApi
  • HawkUpdater
  • HiddenInput
  • HtmlInput
  • HTTPRequest
  • Icon
  • Image
  • IntegerInput
  • ItemList
  • ItemListField
  • JpegImage
  • Lang
  • Language
  • LeftSidebarTab
  • Less
  • Logger
  • Mail
  • MenuItem
  • Model
  • NoSidebarTab
  • NumberInput
  • ObjectInput
  • Option
  • Panel
  • PasswordInput
  • Permission
  • Plugin
  • PluginInstaller
  • PngImage
  • ProfileQuestion
  • ProfileQuestionValue
  • RadioInput
  • Request
  • Response
  • RightSidebarTab
  • Role
  • RolePermission
  • Route
  • Router
  • SelectInput
  • Session
  • Singleton
  • SubmitInput
  • Tabs
  • TextareaInput
  • TextInput
  • Theme
  • TimeInput
  • Upload
  • User
  • View
  • ViewPlugin
  • Widget
  • WysiwygInput

Traits

  • Utils

Exceptions

  • AppStopException
  • DBExampleException
  • DBException
  • FileSystemException
  • HawkApiException
  • ImageException
  • MailException
  • UploadException
  • ViewException

Class Controller

This class describes the behavior of a controller. All controllers defined in application plugins must extend this class for the application routes work.

Hawk\Controller uses Hawk\Utils

Direct known subclasses

Hawk\Widget

Namespace: Hawk
Package: Core
Located at Controller.php

Methods summary

public
# __construct( array $param = array() )

Constructor

Constructor

Parameters

$param

The parameters of the controller. T his parameter is set by the router with the parameters defined in the routes as '{paramName}'

public static Hawk\Controller
# getInstance( array $param = array() )

Get a controller instance

Get a controller instance

Parameters

$param
The parameters to send to the controller instance

Returns

Hawk\Controller
The controller instance
public static Hawk\Controller
# current( )

Get the current controller instance

Get the current controller instance

Returns

Hawk\Controller
The current controller
public mixed
# compute( string $method )

Execute a controller method. This method is called by the router. It execute the controller method, and triggers events before and after the method has been executed, to add widgets or other functionnalities from another plugin than the controller's one.

Execute a controller method. This method is called by the router. It execute the controller method, and triggers events before and after the method has been executed, to add widgets or other functionnalities from another plugin than the controller's one.

Parameters

$method
The method to execute

Returns

mixed
The result of the controller method execution
public
# addCss( string $url )

Add a link tag for CSS inclusion at the end of the HTML result to return to the client

Add a link tag for CSS inclusion at the end of the HTML result to return to the client

Parameters

$url
The URL of the css file to load
public
# addCssInline( string $style )

Add inline CSS at the end of the HTML result to return to the client

Add inline CSS at the end of the HTML result to return to the client

Parameters

$style
The CSS code to insert
public
# addJavaScript( string $url )

Add a script tag at the end of the HTML result to return to the client

Add a script tag at the end of the HTML result to return to the client

Parameters

$url
The URL of the JavaScript file to load
public
# addJavaScriptInline( string $script )

Add inline JavaScript code at the end of the HTML result to return to the client

Add inline JavaScript code at the end of the HTML result to return to the client

Parameters

$script
The JavaScript code to insert
public
# addKeysToJavascript( string $keys )

Add language keys to be accessible by Javascript. To add serveral keys, provide one key by argument Example : $this->addKeysToJavascript('plugin.key1', 'plugin2.key2');

Add language keys to be accessible by Javascript. To add serveral keys, provide one key by argument Example : $this->addKeysToJavascript('plugin.key1', 'plugin2.key2');

Parameters

$keys
$keys The keys to add
public string
# getNamespace( )

Get the controller namespace

Get the controller namespace

Returns

string
the controller namespace
public string
# getClassname( )

Get the controller class

Get the controller class

Returns

string
the controller class
public Hawk\Plugin
# getPlugin( )

Get the plugin contaning the controller

Get the plugin contaning the controller

Returns

Hawk\Plugin
The plugin contaning the controller

Methods used from Hawk\Utils

debug(), getSerializedVersion(), map()

Constants summary

string BEFORE_ACTION

Constant used in events triggered before a controller method to be executed

Constant used in events triggered before a controller method to be executed

# 'before'
string AFTER_ACTION

Constant used in events triggered afrer a controller method has been executed

Constant used in events triggered afrer a controller method has been executed

# 'after'

Properties summary

public static Hawk\Controller $currentInstance

The current used controller. This static property is used to know which is the current controller associated to the current route

The current used controller. This static property is used to know which is the current controller associated to the current route

# null
public string $_plugin

The plugin name the controller is contained in

The plugin name the controller is contained in

#
Hawk - PHP documentation API documentation generated by ApiGen