Inherited by Page.
Public Member Functions | |
| Page_Base () | |
| set_module ($name) | |
| set_ajax ($enable=true) | |
| import_model ($name) | |
| & | import_plugin ($name) |
| redirect ($url) | |
| redirect_to_referrer ($default_url='') | |
| return_to_form ($url, $data, $errors=array()) | |
| flash ($message) | |
| flash_get () | |
| flash_isset () | |
| flash_clear () | |
| param ($key, $default='') | |
| params () | |
| load_input ($req='') | |
| path_args ($shift=0) | |
| param_set ($key, $val) | |
| param_unset ($key) | |
| tget ($key) | |
| tset ($key, $var) | |
| tunset ($key) | |
| tisset ($key) | |
| set_layout ($filename) | |
| render_element ($pagename, $element, $args=array(), $merge_vars=true) | |
| fetch ($filename, $vars=array(), $language=false) | |
| render ($filename, $vars=array(), $layout='') | |
| render_string ($content, $vars=array(), $layout='') | |
| ajax_render ($filename, $jsvars=array()) | |
| ajax_exec ($js='') | |
| GET () | |
| POST () | |
| PUT () | |
| DELETE () | |
| HEAD () | |
Public Attributes | |
| $web | |
| $db | |
| $validator | |
| $sql | |
| $models | |
| $plugins | |
| $ajax | |
| $module_name | |
| $template | |
| $template_layout | |
PRONTO WEB FRAMEWORK Copyright (C) 2006, Judd Vinet
Description: Base class for all page controllers (action/view in MVC terms).
Definition at line 12 of file page.php.
| Page_Base::ajax_exec | ( | $ | js = '' |
) |
Convenience function to pass back JavaScript as an AJAX response.
| string | $js JavaScript to pass back via ajax_render() |
| Page_Base::ajax_render | ( | $ | filename, | |
| $ | jsvars = array() | |||
| ) |
Convenience function to render a template for an AJAX call
| string | $filename Template file to render | |
| array | $jsvars Additional JavaScript variables to pass back |
Definition at line 457 of file page.php.
Referenced by redirect_to_referrer(), render(), and return_to_form().
| Page_Base::fetch | ( | $ | filename, | |
| $ | vars = array(), |
|||
| $ | language = false | |||
| ) |
| Page_Base::flash | ( | $ | message | ) |
| Page_Base::flash_get | ( | ) |
| Page_Base::flash_isset | ( | ) |
| Page_Base::GET | ( | ) |
| Page_Base::import_model | ( | $ | name | ) |
Instantiate one or more models and load them into the holder
| string | $name,... Name(s) of model(s) to import |
Definition at line 98 of file page.php.
References Factory::model().
| & Page_Base::import_plugin | ( | $ | name | ) |
Import a plugin (aka "page plugin").
| string | $name Plugin name |
Definition at line 113 of file page.php.
References Registry::get(), and Factory::plugin().
| Page_Base::load_input | ( | $ | req = '' |
) |
Process an entire associative array of parameters and return it
| array | $req Array to load variables from (default is URL/GET/POST) |
Definition at line 274 of file page.php.
References Registry::get().
| Page_Base::Page_Base | ( | ) |
Constructor for all Page elements
Definition at line 31 of file page.php.
References Registry::get(), param(), set_ajax(), set_layout(), and set_module().
Referenced by Page::Page().
| Page_Base::param | ( | $ | key, | |
| $ | default = '' | |||
| ) |
Fetch a variable from the request arguments, using a default if it doesn't exist
| string | $key Name of request variable to look for. The search order is URL,GET,POST, with latter variables overwriting the former. | |
| string | $default Default to use if variable is missing |
Definition at line 243 of file page.php.
References Registry::get().
Referenced by Page_Base(), and params().
| Page_Base::param_set | ( | $ | key, | |
| $ | val | |||
| ) |
Set (or replace) a parameter in request argument list.
| string | $key | |
| mixed | $val |
Definition at line 302 of file page.php.
References Registry::get(), and Registry::set().
| Page_Base::param_unset | ( | $ | key | ) |
Unset a parameter in request argument list.
| string | $key |
Definition at line 314 of file page.php.
References Registry::get(), and Registry::set().
| Page_Base::params | ( | ) |
| Page_Base::path_args | ( | $ | shift = 0 |
) |
| Page_Base::redirect | ( | $ | url | ) |
Issue a web redirect to a new relative URL
| string | $url |
Definition at line 138 of file page.php.
Referenced by return_to_form().
| Page_Base::redirect_to_referrer | ( | $ | default_url = '' |
) |
Issue a web redirect to the HTTP referrer, falling back to '/' if the referrer is not present
| string | $default_url URL to redirect to if HTTP_REFERER is empty |
Definition at line 149 of file page.php.
References ajax_render(), and url().
Referenced by return_to_form().
| Page_Base::render | ( | $ | filename, | |
| $ | vars = array(), |
|||
| $ | layout = '' | |||
| ) |
Convenience function to render a template
| string | $filename Template file to render | |
| array | $vars Additional variables to include in template | |
| string | $layout Layout template to use. Empty string for default ($this->template_layout) or set to false for none. |
Definition at line 426 of file page.php.
References ajax_render(), and template_layout.
Referenced by Page_Static::GET().
| Page_Base::render_element | ( | $ | pagename, | |
| $ | element, | |||
| $ | args = array(), |
|||
| $ | merge_vars = true | |||
| ) |
Fetch a page element. Page elements function like normal page controllers, except they can only be called by other page controllers and they return rendered content of some kind.
This method can be called through the Page class directly. Example: Page::render_element('MyPage', 'MyElement');
| string | $pagename Name of the page class to use (exclude the 'p' prefix) | |
| string | $element Name of the element to fetch | |
| array | $args Array of arguments to be passed to the element method | |
| boolean | $merge_vars If true, merge template variables from the the rendered element into the current page's scope. |
Definition at line 389 of file page.php.
References $args, Factory::page(), and tset().
| Page_Base::render_string | ( | $ | content, | |
| $ | vars = array(), |
|||
| $ | layout = '' | |||
| ) |
Convenience function to render a string through a layout.
| string | $content Content to render | |
| array | $vars Additional variables to include in template | |
| string | $layout Layout template to use. Empty string for default ($this->template_layout) or set to false for none. |
Definition at line 443 of file page.php.
References DS, and template_layout.
| Page_Base::return_to_form | ( | $ | url, | |
| $ | data, | |||
| $ | errors = array() | |||
| ) |
Used by form handlers to redirect back to the calling form after a failed validation or other errors.
| string | $url URL to redirect to (leave blank to use referrer) | |
| array | $data Form data | |
| array | $errors Form errors |
Definition at line 168 of file page.php.
References ajax_render(), redirect(), and redirect_to_referrer().
| Page_Base::set_ajax | ( | $ | enable = true |
) |
Enable/Disable AJAX mode. When in AJAX mode, the Page::render() method will automatically call Page::ajax_render() instead. Also, debugging output will be disabled in AJAX mode.
| boolean | $enable Set to true to enable, false to disable. |
Definition at line 80 of file page.php.
Referenced by Page_Base().
| Page_Base::set_layout | ( | $ | filename | ) |
Set the layout (base template) file.
| string | $filename |
Definition at line 367 of file page.php.
References template_layout.
Referenced by Page_Base().
| Page_Base::set_module | ( | $ | name | ) |
Declare this controller (and template object) to be part of a Pronto module.
| string | $name Module name |
Definition at line 67 of file page.php.
Referenced by Page_Base().
| Page_Base::tget | ( | $ | key | ) |
| Page_Base::tisset | ( | $ | key | ) |
| Page_Base::tset | ( | $ | key, | |
| $ | var | |||
| ) |
Convenience function for template variables
| mixed | $key | |
| mixed | $var |
Definition at line 341 of file page.php.
Referenced by Page::Page(), and render_element().
| Page_Base::tunset | ( | $ | key | ) |
| Page_Base::$template_layout |
1.6.1