$action =
[line 66]
Name of the action method in the controller class
Set by recognize_route()
Tags:
$action_called = false
[line 221]
Tags:
$action_params = array()
[line 91]
Parameters for the action routine
Set by recognize_route(), passed as arguments to the controller's action routine.
Tags:
$added_path = ''
[line 82]
Path to add to other filesystem paths
Set by recognize_route()
Tags:
$after_filter = null
[line 231]
Tags:
$after_filters = array()
[line 211]
List of filters to execute after calling action method
Set by add_after_filters()
Tags:
$application_controller_file =
[line 158]
Filesystem path to application.php file
Set by recognize_route()
Tags:
$application_helper_file =
[line 166]
Filesystem path to application_helper.php file
Set by recognize_route()
Tags:
$asset_host = null
[line 281]
Tags:
$before_filter = null
[line 226]
Tags:
$before_filters = array()
[line 203]
List of filters to execute before calling action method
Set by add_before_filters()
Tags:
$controller =
[line 58]
Name of the controller (without the _controller.php)
Set by recognize_route() by parsing the URL and the routes in routes.php. The value of this string is set before any attempt is made to find the file containing the controller.
Tags:
$controllers_path =
[line 99]
Filesystem path to ../app/controllers/ directory
Set by recognize_route()
Tags:
$controller_class =
[line 265]
Class name of the controller
Set by recognize_route(). Derived from contents of $controller.
Tags:
$controller_file =
[line 240]
Filesystem path to the PHP program file for this controller
Set by recognize_route()
Tags:
$controller_object =
[line 273]
Instance of the controller class
Set by process_route()
Tags:
$helpers = array()
[line 195]
List of additional helper files for this controller object
Set by add_helper()
Tags:
$helpers_base_path =
[line 115]
Filesystem path to ../app/helpers/ directory
Set by recognize_route()
Tags:
$helpers_path =
[line 107]
Filesystem path to ../app/helpers/
extras directory
Set by recognize_route(), set_paths()
Tags:
$helper_file =
[line 149]
Filesystem path to the controllername_helper.php file
Set by recognize_route()
Tags:
$id =
[line 74]
Value of :id parsed from URL then forced to lower case
Set by recognize_route()
Tags:
$keep_flash = false
[line 303]
Whether to keep flash message after displaying it
Tags:
$layouts_base_path =
[line 131]
Filesystem path to ../app/views/layouts/ directory
Set by recognize_route()
Tags:
$layouts_path =
[line 123]
Filesystem path to ../app/views/layouts/
extras directory
Set by recognize_route(), set_paths()
Tags:
$loaded = false
[line 174]
URL recognized, paths resoved, controller file found
Set by recognize_route()
Tags:
$render_layout = true
[line 297]
Render controllers layout
Can be overridden in the child controller to false
Tags:
$render_performed = false
[line 216]
Tags:
$router_loaded = false
[line 187]
Whether a Router object was loaded
Tags:
$url_path =
[line 141]
User's URL in components
Contains user's URL stripped of TRAX_URL_PREFIX and leading and trailing slashes, then exploded into an array on slash boundaries.
Tags:
$views_file_extention = TRAX_VIEWS_EXTENTION
[line 289]
File extension appended to view files
Set from a define in environment.php. Usually phtml
Tags:
$views_path =
[line 256]
Filesystem path to the ../app/views/ directory
Set by recognize_route()
Tags:
$view_file =
[line 248]
Filesystem path to the view file selected for this action
Set by process_route()
Tags:
constructor __construct [line 309]
ActionController __construct(
)
|
|
Build a Router object and load routes from config/route.php
Tags:
method add_after_filter [line 860]
void add_after_filter(
mixed
$filter_function_name)
|
|
Append an after filter to the filter chain
Tags:
Parameters:
method add_before_filter [line 822]
void add_before_filter(
mixed
$filter_function_name)
|
|
Append a before filter to the filter chain
Tags:
Parameters:
method add_helper [line 882]
void add_helper(
$helper_name
$helper_name)
|
|
Add a helper to the list of helpers used by a controller object
Tags:
Parameters:
method determine_layout [line 1152]
mixed determine_layout(
[mixed
$full_path = true])
|
|
Select a layout file based on the controller object
Tags:
method execute_after_filters [line 841]
void execute_after_filters(
)
|
|
Execute the after filters
Tags:
method execute_before_filters [line 799]
void execute_before_filters(
)
|
|
Execute the before filters
Tags:
method load_router [line 372]
Load routes from configuration file config/routes.php
Routes are loaded by requiring routes.php from the configuration directory. The file routes.php contains statements of the form "$router->connect(path,params);" where (path,params) describes the route being added by the statement. Route syntax is described in the Router class tutorial.
Tags:
method process_route [line 566]
Parse URL, extract controller and action and execute them
Tags:
method process_with_exception [line 1258]
void process_with_exception(
mixed
&$exception)
|
|
Generate an HTML page describing an error
Tags:
method raise [line 1251]
void raise(
string
$error_message, string
$error_heading, [string
$error_code = "404"])
|
|
Raise an ActionControllerError exception
Tags:
Parameters:
method recognize_route [line 420]
boolean recognize_route(
)
|
|
Convert URL to controller, action and id
Parse the URL in $_SERVER['REDIRECT_URL'] into elements. Compute filesystem paths to the various components used by the URL and store the paths in object private variables. Verify that the controller exists.
Tags:
method redirect_to [line 1232]
void redirect_to(
[mixed
$options = null])
|
|
Redirect the browser to a specified target
Redirect the browser to the target specified in $options. This parameter can take one of three forms:
- Array: The URL will be generated by calling
url_for() with the options.
- String starting with a protocol:// (like http://): Is
passed straight through as the target for redirection.
- String not containing a protocol: The current protocol
and host is prepended to the string.
- back: Back to the page that issued the request. Useful
for forms that are triggered from multiple
places. Short-hand for redirect_to(request.env["HTTP_REFERER"])
Examples:
- redirect_to(array(":action" => "show", ":id" => 5))
- redirect_to("http://www.rubyonrails.org")
- redirect_to("/images/screenshot.jpg")
- redirect_to("back")
Tags:
Parameters:
method render [line 893]
void render(
[mixed
$options = array()], [mixed
$locals = array()], [mixed
$return_as_string = false])
|
|
Renders the content that will be returned to the browser as the response body.
method render_action [line 983]
void render_action(
mixed
$action, [mixed
$options = array()])
|
|
Action rendering is the most common form and the type used automatically by Action Controller when nothing else is specified. By default, actions are rendered within the current layout (if one exists).
- Renders the template for the action "goal" within the current controller
render(array("action" => "goal"))
- Renders the template for the action "short_goal" within the current controller,
- but without the current active layout
render(array("action" => "short_goal", "layout" => false))
- Renders the template for the action "long_goal" within the current controller,
- but with a custom layout
render(array("action" => "long_goal", "layout" => "spectacular"))
method render_file [line 1025]
void render_file(
mixed
$path, [mixed
$use_full_path = false], [mixed
$locals = array()])
|
|
File rendering works just like action rendering except that it takes a filesystem path.
By default, the path is assumed to be absolute, and the current layout is not applied.
- Renders the template located at the absolute filesystem path
render(array("file" => "/path/to/some/template.phtml")) render(array("file" => "c:/path/to/some/template.phtml"))
- Renders a template within the current layout
render(array("file" => "/path/to/some/template.rhtml", "layout" => true)) render(array("file" => "c:/path/to/some/template.rhtml", "layout" => true))
- Renders a template relative to app/views
render(array("file" => "some/template", "use_full_path" => true))
method render_partial [line 1095]
void render_partial(
string
$path, [string[]
$options = array()])
|
|
Rendering partials
Partial rendering is most commonly used together with Ajax calls that only update one or a few elements on a page without reloading. Rendering of partials from the controller makes it possible to use the same partial template in both the full-page rendering (by calling it from within the template) and when sub-page updates happen (from the controller action responding to Ajax calls). By default, the current layout is not used.
- render_partial("win");
Renders the partial
located at app/views/controller/_win.phtml - render_partial("win",
array("locals" => array("name" => "david")));
Renders the same partial but also makes a local variable
available to it - render_partial("win",
array("collection" => array(...)));
Renders a collection of the same partial by making each
element of the collection available through the local variable
"win" as it builds the complete response - render_partial("win", array("collection" => $wins,
"spacer_template" => "win_divider"));
Renders the same collection of partials, but also renders
the win_divider partial in between each win partial.
Parameters:
method render_text [line 954]
void render_text(
mixed
$text, [mixed
$options = array()])
|
|
Rendering of text is usually used for tests or for rendering prepared content.
By default, text rendering is not done within the active layout.
- Renders the clear text "hello world"
render(array("text" => "hello world!"))
- Renders the clear text "Explosion!"
render(array("text" => "Explosion!"))
- Renders the clear text "Hi there!" within the current active layout (if one exists)
render(array("text" => "Explosion!", "layout" => true))
- Renders the clear text "Hi there!" within the layout
- placed in "app/views/layouts/special.phtml"
render(array("text" => "Explosion!", "layout" => "special"))
method render_to_string [line 1005]
void render_to_string(
[mixed
$options = array()], [mixed
$locals = array()])
|
|
Renders according to the same rules as render, but returns the result in a string instead of sending it as the response body to the browser.
method set_paths [line 771]
Extend the search path for components
On entry, $url_path is set according to the browser's URL and $controllers_path has been set according to the configuration in config/environment.php . Examine the $controllers_path directory for files or directories that match any component of the URL. If one is found, add that component to all paths. Replace the contents of $url_path with the list of URL components that did NOT match any files or directories.
Tags:
method __call [line 342]
void __call(
mixed
$method_name, mixed
$parameters)
|
|
Tags:
method __set [line 321]
void __set(
mixed
$key, mixed
$value)
|
|
Tags: