Create controller based on the given URI.
Parameters:
API Tags:
| Return: | the controller |
| Access: | protected |
Bridge factory method. Returns the currently configured controller bridge.
If an instance already exists, re-uses it, else a new bridge will be created.
API Tags:
| Return: | front controller bridge |
| Access: | protected |
static string dispatchRequest(
[array
$vars = array()], [bool
$merge = true]
)
|
|
Dispatch request. Find the right controller, let it handle the request and return it's result.
Parameters:
|
array |
$vars: |
custom variables, will be merged with the request variables and overwrite existing (request) variables with the same name unless $merge is set to false |
|
bool |
$merge: |
merge custom and request variables? |
API Tags:
| Return: | controller result |
| Access: | public |
Returns the current controller instance. This can either be the root or a nested controller.
API Tags:
| Return: | current controller instance |
| Access: | protected |
Sets the current controller instance.
Parameters:
API Tags:
static array uriParts(
string
$uri
)
|
|
Returns the parts from the uri like module, controller and action
Parameters:
API Tags:
| Return: | array(module,controller,action) |
| Access: | protected |
atkFrontController __construct(
string
$module, string
$name, string
$action, [atkFrontController
$parent = NULL]
)
|
|
Constructor.
Parameters:
|
string |
$module: |
module name |
|
string |
$name: |
controller name |
|
string |
$action: |
|
|
atkFrontController |
$parent: |
|
API Tags:
void addHeader(
string
$header
)
|
|
Add response header. (Will only be outputted when renderPartial or renderContent is called for the root controller).
Parameters:
|
string |
$header: |
The header to add |
API Tags:
string buildUrl(
string
$uri, array
$vars
)
|
|
Build url using the given URI and variables.
Parameters:
|
string |
$uri: |
The controller URI. |
|
array |
$vars: |
Request vars. |
API Tags:
| Return: | url |
| Access: | protected |
void doRedirect(
string
$url
)
|
|
Redirect to the given url.
Parameters:
API Tags:
string formVarsFunctionTag(
array
$params, Smarty
$smarty
)
|
|
Smarty function for converting the controller, action etc.
to hidden form vars.
Parameters:
|
array |
$params: |
parameters |
|
Smarty |
$smarty: |
smarty reference |
API Tags:
| Return: | hidden form vars html |
| Access: | public |
Returns the action.
API Tags:
| Return: | action |
| Access: | protected |
Get action cache file.
API Tags:
void getActionCacheKey(
)
|
|
Get action cache key.
API Tags:
ReflectionMethod getActionMethod(
)
|
|
Get the method to call for the current request.
API Tags:
| Return: | The method. |
| Access: | protected |
string getFileForTemplate(
string
$template, array
$vars, [bool
$partial = false]
)
|
|
Transform the template to use to a filename
example: getFileForTemplate('tekno'): module/controller/tekno.tpl
Parameters:
|
string |
$template: |
|
|
array |
$vars: |
|
|
bool |
$partial: |
|
API Tags:
| Return: | Filename for the template |
| Access: | protected |
void getLayoutTemplatePath(
)
|
|
Returns the layout template path for this controller.
API Tags:
Returns the controller module.
API Tags:
| Return: | controller module |
| Access: | protected |
Returns the controller name.
API Tags:
| Return: | controller name |
| Access: | protected |
Returns the parent controller.
API Tags:
| Return: | parent |
| Access: | protected |
Returns the request parameters.
API Tags:
| Return: | request parameters |
| Access: | protected |
Returns the root controller.
API Tags:
| Return: | root |
| Access: | protected |
Returns the session.
API Tags:
| Return: | session |
| Access: | protected |
Get current template.
API Tags:
| Return: | template name |
| Access: | protected |
string getTemplatePath(
string
$template, [string
$directory = 'templates']
)
|
|
Returns the template path for the given template.
Parameters:
|
string |
$template: |
template name |
|
string |
$directory: |
the base template directory |
API Tags:
| Return: | template path |
| Access: | protected |
Returns the correct key value for the uri in forms and url's Defaults to 'uri'
API Tags:
| Return: | uri_key |
| Access: | protected |
Get assigned template variables.
API Tags:
| Return: | template variables |
| Access: | protected |
void handleException(
Exception
$exception
)
|
|
Handle exception.
Parameters:
|
Exception |
$exception: |
exception |
API Tags:
result handleRequest(
array
$request
)
|
|
Handle action.
Parameters:
|
array |
$request: |
request variables |
API Tags:
| Return: | of action |
| Access: | protected |
Init will be called just after preFilter and just before the request is dispatched to the right method.
API Tags:
Install smarty plug-ins.
API Tags:
Is this action cached?
API Tags:
Is this the root controller?
API Tags:
| Return: | is root controller? |
| Access: | protected |
void linkBlockTag(
array
$params, string
$content, Smarty
$smarty,
&$repeat, boolean
$repeat
)
|
|
Smarty wrapper function for the url function.
Parameters:
|
array |
$params: |
parameters |
|
string |
$content: |
content between link tags |
|
Smarty |
$smarty: |
smarty reference |
|
boolean |
$repeat: |
true first time |
|
|
&$repeat: |
|
API Tags:
void loadFromActionCache(
)
|
|
Load from action cache.
API Tags:
bool offsetExists(
mixed
$offset
)
|
|
Checks if a certain offset exists.
Parameters:
API Tags:
| Return: | offset exists? |
| Access: | public |
Implementation of:
- ArrayAccess::offsetExists
mixed offsetGet(
mixed
$offset
)
|
|
Returns the value at the given offset.
Parameters:
API Tags:
| Return: | value |
| Access: | public |
Implementation of:
- ArrayAccess::offsetGet
void offsetSet(
mixed
$offset, mixed
$value
)
|
|
Sets the given offset with the given value
Parameters:
|
mixed |
$offset: |
offset |
|
mixed |
$value: |
value |
API Tags:
Implementation of:
- ArrayAccess::offsetSet
void offsetUnset(
mixed
$offset
)
|
|
Unsets the given offset.
Parameters:
API Tags:
Implementation of:
- ArrayAccess::offsetUnset
string partialFunctionTag(
array
$params, Smarty
$smarty
)
|
|
Smarty partial function, render partial template.
Parameters:
|
array |
$params: |
parameters |
|
Smarty |
$smarty: |
smarty instance |
API Tags:
| Return: | rendered partial |
| Access: | public |
Will be called just after the request has been dispatched to the right method and the rendering took place but before the result is returned or outputted.
API Tags:
Will be called just before the request is dispatched to the right method.
API Tags:
string redirect(
[string
$controller = NULL], [string
$action = NULL], [array
$vars = array()], [bool
$force = FALSE]
)
|
|
Redirect to the given url.
Parameters:
|
string |
$controller: |
controller name (uses current if empty) |
|
string |
$action: |
action name (uses current if empty and controller isn't changed, uses index if empty and other controller) |
|
array |
$vars: |
request vars |
|
bool |
$force: |
Force redirect? |
API Tags:
| Return: | url |
| Access: | protected |
void registerScriptCode(
string
$code
)
|
|
Register JavaScript code.
Parameters:
API Tags:
void registerScriptFile(
string
$file
)
|
|
Register script file.
Parameters:
|
string |
$file: |
script filename |
API Tags:
void registerStyleCode(
string
$code
)
|
|
Register stylesheet code.
Parameters:
|
string |
$code: |
stylesheet code |
API Tags:
void registerStylesAndScripts(
)
|
|
Register styles and scripts using the bridge.
API Tags:
void registerStyleSheet(
string
$file, [string
$media = 'all']
)
|
|
Register stylesheet of the given media type.
Parameters:
|
string |
$file: |
stylesheet filename |
|
string |
$media: |
media type (defaults to 'all') |
API Tags:
void render(
[string
$template = NULL], [array
$vars = NULL], [boolean
$partial = false]
)
|
|
Render template.
Will assign the partial and result variables and will prevent double rendering!
Parameters:
|
string |
$template: |
template name |
|
array |
$vars: |
template variables |
|
boolean |
$partial: |
render partial? |
API Tags:
void renderContent(
string
$content
)
|
|
Render content.
Will assign the partial and result variables and will prevent double rendering!
Parameters:
|
string |
$content: |
content to render |
API Tags:
void renderPartial(
[string
$template = NULL], [array
$vars = NULL]
)
|
|
Render partial.
Will assign the partial and result variables and will prevent double rendering!
Parameters:
|
string |
$template: |
template name |
|
array |
$vars: |
template variables |
API Tags:
void setCacheableActions(
array|string
$actions, ...
1
)
|
|
Sets the cacheable actions.
Parameters:
|
array|string |
$actions: |
cacheable actions |
|
... |
1: |
|
API Tags:
void setContentType(
string
$contentType
)
|
|
Sets the content type (Will only be outputted when renderPartial or renderContent is called for the root controller).
Parameters:
API Tags:
void setLocale(
string
$lng
)
|
|
Set locale based on the given language.
Parameters:
|
string |
$lng: |
language (ISO code) |
API Tags:
void setTemplate(
string
$template
)
|
|
Set current template.
Parameters:
|
string |
$template: |
template name |
API Tags:
void storeInActionCache(
)
|
|
Store current action results in cache.
API Tags:
Uninstall smarty plug-ins.
API Tags:
string uri(
string
$controller, string
$action
)
|
|
Build the URI for the given controller and action.
Parameters:
|
string |
$controller: |
controller name (uses current if empty) |
|
string |
$action: |
action name (uses current if empty and controller isn't changed, uses index if empty and other controller) |
API Tags:
| Return: | uri |
| Access: | protected |
string url(
[string
$controller = NULL], [string
$action = NULL], [array
$vars = array()]
)
|
|
Build url or return the current url.
Parameters:
|
string |
$controller: |
controller name (uses current if empty) |
|
string |
$action: |
action name (uses current if empty and controller isn't changed, uses index if empty and other controller) |
|
array |
$vars: |
request vars |
API Tags:
| Return: | url |
| Access: | protected |
string urlFunctionTag(
array
$params, Smarty
$smarty
)
|
|
Smarty wrapper function for the url function.
Parameters:
|
array |
$params: |
parameters |
|
Smarty |
$smarty: |
smarty reference |
API Tags:
| Return: | url |
| Access: | public |
string _render(
string
$template, array
$vars, boolean
$partial
)
|
|
Render template.
Parameters:
|
string |
$template: |
template name |
|
array |
$vars: |
template variables |
|
boolean |
$partial: |
render partial? |
API Tags:
| Return: | rendered template |
| Access: | protected |
unknown &__get(
string
$name
)
|
|
Get template variable value.
Parameters:
|
string |
$name: |
variable name |
API Tags:
void __isset(
string
$name
)
|
|
Is template variable set?
Parameters:
API Tags:
void __set(
string
$name, unknown
$value
)
|
|
Template variable assignment.
Parameters:
|
string |
$name: |
variable name |
|
unknown |
$value: |
variable value |
API Tags: