Api
class Api extends DashboardPageController (View source)
Traits
Properties
protected Application | $app | from ApplicationAwareTrait | |
protected | $helpers | {@inheritdoc} | from DashboardPageController |
protected array | $sets | The values to be sent to views. | from AbstractController |
protected | $action | from PageController | |
protected Request|null | $request | The current request instance. | from AbstractController |
protected | $parameters | from PageController | |
protected | $view | from Controller | |
protected | $viewPath | from Controller | |
protected | $theme | from Controller | |
protected | $controllerActionPath | from Controller | |
protected | $themeViewTemplate | from Controller | |
protected | $supportsPageCache | from PageController | |
protected | $passThruBlocks | from PageController | |
protected | $replacement | from PageController | |
protected | $requestValidated | from PageController | |
protected | $restrictedMethods | {@inheritdoc} | from DashboardPageController |
protected string|null | $customRequestPath | Custom request path - overrides Request::getPath() (useful when replacing controllers). | from PageController |
Page | $c | from PageController | |
Token|null | $token | The Token instance (available after the on_start method has been called). | from DashboardPageController |
protected ErrorList|null | $error | The ErrorList instance (available after the on_start method has been called). | from DashboardPageController |
protected EntityManagerInterface|null | $entityManager | The EntityManager instance (available after the on_start method has been called). | from DashboardPageController |
Methods
Adds an item to the view's header. This item will then be automatically printed out before the
section of the page.Adds an item to the view's footer. This item will then be automatically printed out before the section of the page.
Should the action be executed? Override this method to answer something different than true.
Get the the helpers that will be be automatically sent to Views as variables.
Get the whole $_GET array or a specific querystring value.
Override this method to do something right before the view is rendered.
Get the whole $_POST array or a specific posted value.
Redirect the clients to a specific URL/page (specify path(s) as argument(s) of this function).
Perform an action of this controller (if shouldRunControllerTask returns true).
Get the whole $_REQUEST array or a specific requested value.
Returns the wrapper file that holds the content of the view. Usually view.php
Given either a path or a Page object, this is a shortcut to 1. Grab the controller of THAT page.
Set the custom request path (useful when replacing controllers).
Get the custom request path (useful when replacing controllers).
Given a path to a single page, this command uses the CURRENT controller and renders the contents of the single page within this request. The current controller is not replaced, and has already fired (since it is meant to be called from within a view() or similar method).
Should this page be displayed using the user's language?
Override this method to send content created by the page controller to the indexer
Check if the current user is using a mobile device: if so, configure the dashboard page accordingly.
Get the EntityManager instance (available after the on_start method has been called).
No description
Details
in ApplicationAwareTrait at line 19
setApplication(Application $app)
Setter method for the application
in PageController at line 46
__construct(Page $c)
Initialize the instance.
in AbstractController at line 67
Request
getRequest()
Get the current request instance.
in AbstractController at line 81
setRequest(Request $request)
Set the current request instance.
in AbstractController at line 92
requireAsset()
Add an asset required in views.
This function accept the same parameters as the requireAsset method of the ResponseAssetGroup.
in AbstractController at line 104
addHeaderItem(string $item)
Adds an item to the view's header. This item will then be automatically printed out before the
section of the page.
in AbstractController at line 115
addFooterItem(string $item)
Adds an item to the view's footer. This item will then be automatically printed out before the section of the page.
in AbstractController at line 127
set(string $key, mixed $val)
Set a value to be sent to the view.
in PageController at line 113
array
getSets()
Get the values to be sent to views.
in AbstractController at line 147
bool
shouldRunControllerTask()
Should the action be executed? Override this method to answer something different than true.
in AbstractController at line 158
array
getHelperObjects()
Get the the helpers that will be be automatically sent to Views as variables.
Array keys are the variable names, array values are the helper instances.
in AbstractController at line 177
mixed
get(string|null $key = null, mixed $defaultValue = null)
Get the whole $_GET array or a specific querystring value.
in AbstractController at line 195
getTask()
deprecated
deprecated
in AbstractController at line 205
string|null
getAction()
Get the action to be performed.
in AbstractController at line 215
array|null
getParameters()
Get the action parameters.
on_start()
Override this method to perform controller initializations.
on_before_render()
Override this method to do something right before the view is rendered.
For instance, you can call $this->set('variableName', $variableValue) to send the view additional sets.
in AbstractController at line 238
isPost()
deprecated
deprecated
in AbstractController at line 251
mixed
post(string|null $key = null, mixed $defaultValue = null)
Get the whole $_POST array or a specific posted value.
in AbstractController at line 261
redirect()
deprecated
deprecated
Redirect the clients to a specific URL/page (specify path(s) as argument(s) of this function).
in AbstractController at line 275
runTask(mixed $action, mixed $parameters)
deprecated
deprecated
in AbstractController at line 288
mixed
runAction(string $action, array $parameters = [])
Perform an action of this controller (if shouldRunControllerTask returns true).
in AbstractController at line 306
mixed
request(string|null $key = null)
Get the whole $_REQUEST array or a specific requested value.
in Controller at line 17
setViewObject(View $view)
in Controller at line 22
setTheme($mixed)
in PageController at line 163
getTheme()
in Controller at line 36
setThemeViewTemplate($template)
in Controller at line 45
string
getThemeViewTemplate()
Returns the wrapper file that holds the content of the view. Usually view.php
in PageController at line 190
getControllerActionPath()
in Controller at line 86
flash($key, $value, $isHTML = false)
in Controller at line 92
getViewObject()
in Controller at line 102
action()
in PageController at line 41
supportsPageCache()
in PageController at line 64
replace(@string|Page $var)
Given either a path or a Page object, this is a shortcut to 1. Grab the controller of THAT page.
- Grab the view of THAT controller
- Render that view.
- Exit – so we immediately stop all other output in the controller that called render().
in PageController at line 88
setCustomRequestPath(string|null $requestPath)
Set the custom request path (useful when replacing controllers).
in PageController at line 98
string|null
getCustomRequestPath()
Get the custom request path (useful when replacing controllers).
in PageController at line 103
isReplaced()
in PageController at line 108
getReplacement()
in PageController at line 140
render($path, $pkgHandle = null)
Given a path to a single page, this command uses the CURRENT controller and renders the contents of the single page within this request. The current controller is not replaced, and has already fired (since it is meant to be called from within a view() or similar method).
in PageController at line 158
getPageObject()
in PageController at line 180
getRequestAction()
in PageController at line 185
getRequestActionParameters()
in PageController at line 201
setupRequestActionAndParameters(Request $request)
in PageController at line 257
isValidControllerTask($action, $parameters = array())
in PageController at line 280
setPassThruBlockController(Block $b, BlockController $controller)
in PageController at line 285
getPassThruBlockController(Block $b)
in PageController at line 292
validateRequest()
bool
useUserLocale()
Should this page be displayed using the user's language?
in PageController at line 357
getSearchableContent()
Override this method to send content created by the page controller to the indexer
enableNativeMobile()
Check if the current user is using a mobile device: if so, configure the dashboard page accordingly.
EntityManagerInterface|null
getEntityManager()
Get the EntityManager instance (available after the on_start method has been called).