|
| before_filter (&$action, &$args) |
|
| erase_response () |
|
| perform ($unconsumed_path) |
|
| after_filter ($action, $args) |
|
| validate_args (&$args, $types=null) |
|
| url_for ($to= '') |
|
| link_for ($to= '') |
|
| redirect ($to) |
|
| relocate ($to) |
|
| rescue ($exception) |
|
| render_json ($data) |
|
| render_csv ($data, $filename=null, $delimiter= ';', $enclosure= '"') |
|
| render_file ($file, $filename=null, $content_type=null, $content_disposition= 'attachment', Closure $callback=null, $chunk_size=262144) |
|
| render_temporary_file ($file, $filename=null, $content_type=null, $content_disposition= 'attachment', Closure $callback=null, $chunk_size=262144) |
|
| relay ($to_uri) |
|
| relayWithRedirect (...$args) |
|
| perform_relayed ($unconsumed) |
|
| render_template_as_string ($template, $layout=null) |
|
| __call ($method, $arguments) |
|
| has_action ($action) |
|
| action_url ($action) |
|
| action_link ($action) |
|
| validate_datetime ($datetime, $format= 'H:i') |
|
__call |
( |
|
$method, |
|
|
|
$arguments |
|
) |
| |
Magic methods that intercepts all unknown method calls. If a method is called that matches an action on this controller, an url to that action is generated.
Basically, this:
$controller->url_for('foo/bar/baz/' . $param)
is equal to calling this on the Foo_BarController:
$controller->baz($param)
- Parameters
-
String | $method | Called method name |
array | $argumetns | Provided arguments |
- Returns
- url to the requested action
- Exceptions
-
Trails_UnknownAction | if no action matches the method |
Generates the link for an action on this controller without the neccessity to provide the full "path" to the action (since it is implicitely known).
Basically, this:
$controller->link_for('foo/bar/baz/' . $param)
is equal to calling this on the Foo_BarController:
$controller->action_link('baz/' . $param)
- Parameters
-
string | $action | Name of the action |
- Returns
- string to the requested action
Generates the url for an action on this controller without the neccessity to provide the full "path" to the action (since it is implicitely known).
Basically, this:
$controller->url_for('foo/bar/baz/' . $param)
is equal to calling this on the Foo_BarController:
$controller->action_url('baz/' . $param)
- Parameters
-
string | $action | Name of the action |
- Returns
- string url to the requested action
after_filter |
( |
|
$action, |
|
|
|
$args |
|
) |
| |
Callback function being called after an action is executed.
- Parameters
-
string | Name of the action to perform. |
array | An array of arguments to the action. |
- Returns
- void
before_filter |
( |
& |
$action, |
|
|
& |
$args |
|
) |
| |
Returns the url path to this controller.
- Returns
- string url path to this controller
Extended method to inject extended response object.
getBodyElementIdForControllerAndAction |
( |
|
$unconsumed_path | ) |
|
|
protected |
Creates the body element id for this controller a given action.
- Parameters
-
string | $unconsumed_path | Unconsumed path to extract action from |
- Returns
- string
Returns whether this controller has the specificed action.
- Parameters
-
string | $action | Name of the action |
- Returns
- true if action is defined, false otherwise
Returns an escaped URL to a specified route to your Trails application. without first parameter the current action is used if route begins with a / then the current controller ist prepended if second parameter is an array it is passed to URLHeper
- Parameters
-
string | a string containing a controller and optionally an action |
strings | optional arguments |
- Returns
- string a URL to this route
perform |
( |
|
$unconsumed_path | ) |
|
Hooked perform method in order to inject body element id creation.
In order to avoid clashes, these body element id will be joined with a minus sign. Otherwise the controller "x" with action "y_z" would be given the same id as the controller "x/y" with the action "z", namely "x_y_z". With the minus sign this will result in the ids "x-y_z" and "x_y-z".
Plugins will always have a leading 'plugin-' and the decamelized plugin name in front of the id.
- Parameters
-
String | $unconsumed_path | Path segment containing action and optionally arguments or format |
- Returns
- Trails_Response from parent controller
perform_relayed |
( |
|
$unconsumed | ) |
|
perform a given action/parameter string from an relayed request before_filter and after_filter methods are not called
- See Also
- perform
- Parameters
-
- Returns
- Trails_Response
relays current request to another controller and returns the response the other controller is given all assigned properties, additional parameters are passed through
- Parameters
-
string | $to_uri | a trails route |
- Returns
- Trails_Response
relayWithRedirect |
( |
|
$args | ) |
|
Relays current request and performs redirect if neccessary.
- Parameters
-
string | $to_uri | a trails route |
- Returns
- Trails_Response
- See Also
- StudipController::relay()
Relocate the user to another location. This is a specialized version of redirect that differs in two points:
- Parameters
-
render_csv |
( |
|
$data, |
|
|
|
$filename = null , |
|
|
|
$delimiter = ';' , |
|
|
|
$enclosure = '"' |
|
) |
| |
Render given data as csv, data is assumed to be utf-8. The first row of data may contain column titles.
- Parameters
-
array | $data | data as two dimensional array |
string | $filename | download file name (optional) |
string | $delimiter | field delimiter char (optional) |
string | $enclosure | field enclosure char (optional) |
render_file |
( |
|
$file, |
|
|
|
$filename = null , |
|
|
|
$content_type = null , |
|
|
|
$content_disposition = 'attachment' , |
|
|
Closure |
$callback = null , |
|
|
|
$chunk_size = 262144 |
|
) |
| |
Renders a file
- Parameters
-
string | $file | Path of the file to render |
string | $filename | Name of the file displayed to user (will equal $file when missing) |
string | $content_type | Optional content type (will be determined if missing) |
string | $content_disposition | Either attachment (default) or inline |
Closure | $callback | Optional callback when download has finished |
int | $chunk_size | Optional size of chunks to send (default: 256k) |
render given data as json, data is converted to utf-8
- Parameters
-
render_pdf |
( |
TCPDF |
$pdf, |
|
|
|
$filename, |
|
|
|
$inline = false |
|
) |
| |
|
protected |
Renders a pdf file given by a TCPDF/ExportPDF object.
- Parameters
-
TCPDF | $pdf | TCPDF object to render |
string | $filename | Filename |
bool | $inline | Should the pdf be displayed inline (default: no) |
render_template_as_string |
( |
|
$template, |
|
|
|
$layout = null |
|
) |
| |
Renders a given template and returns the resulting string.
- Parameters
-
string | $template | Name of the template file |
mixed | $layout | Optional layout |
- Returns
- string
render_temporary_file |
( |
|
$file, |
|
|
|
$filename = null , |
|
|
|
$content_type = null , |
|
|
|
$content_disposition = 'attachment' , |
|
|
Closure |
$callback = null , |
|
|
|
$chunk_size = 262144 |
|
) |
| |
Renders a temporary file which will be deleted after transmission. This is just a convenience method so you don't have to write the delete callback.
- Parameters
-
string | $file | Path of the file to render |
string | $filename | Name of the file displayed to user (will equal $file when missing) |
string | $content_type | Optional content type (will be determined if missing) |
string | $content_disposition | Either attachment (default) or inline |
Closure | $callback | Optional callback when download has finished |
int | $chunk_size | Optional size of chunks to send (default: 256k) |
Exception handler called when the performance of an action raises an exception.
- Parameters
-
object | the thrown exception |
Returns a URL to a specified route to your Trails application. without first parameter the current action is used if route begins with a / then the current controller ist prepended if second parameter is an array it is passed to URLHeper
- Parameters
-
string | a string containing a controller and optionally an action |
string[] | optional arguments |
- Returns
- string a URL to this route
validate_args |
( |
& |
$args, |
|
|
|
$types = null |
|
) |
| |
Validate arguments based on a list of given types. The types are: 'int', 'float', 'option' and 'string'. If the list of types is NULL or shorter than the argument list, 'option' is assumed for all remaining arguments. 'option' differs from Request::option() in that it also accepts the charaters '-' and ',' in addition to all word characters.
Since Stud.IP 4.0 it is also possible to directly inject SimpleORMap objects. If types is NULL, the signature of the called action is analyzed and any type hint that matches a sorm class will be used to create an object using the argument as the id that is passed to the object's constructor.
If $_autobind is set to true, the created object is also assigned to the controller so that it is available in a view.
- Parameters
-
array | $args | an array of arguments to the action |
array | $types | list of argument types (optional) |
validate_datetime |
( |
|
$datetime, |
|
|
|
$format = 'H:i' |
|
) |
| |
Validate the datetime according to specific format.
- Parameters
-
string | $datetime | the datetime which should be validate |
string | $format | the format that the datetime should have by default H:i for time |
- Returns
- bool result of validation
The documentation for this class was generated from the following file: