Inheritance diagram for View:

Public Member Functions | |
| __construct (&$controller, $register=true) | |
| _getLayoutFileName ($name=null) | |
| _getViewFileName ($name=null) | |
| & | _loadHelpers (&$loaded, $helpers, $parent=null) |
| _missingView ($file, $error= 'missingView') | |
| _paths ($plugin=null, $cached=true) | |
| _render ($___viewFn, $___dataForView, $loadHelpers=true, $cached=false) | |
| _triggerHelpers ($callback) | |
| addScript ($name, $content=null) | |
| element ($name, $params=array(), $loadHelpers=false) | |
| entity () | |
| error ($code, $name, $message) | |
| getVar ($var) | |
| getVars () | |
| render ($action=null, $layout=null, $file=null) | |
| renderCache ($filename, $timeStart) | |
| renderElement ($name, $params=array(), $loadHelpers=false) | |
| renderLayout ($content_for_layout, $layout=null) | |
| set ($one, $two=null) | |
| uuid ($object, $url) | |
Public Attributes | |
| $__passedVars | |
| $__paths = array() | |
| $__scripts = array() | |
| $action = null | |
| $association = null | |
| $autoLayout = true | |
| $autoRender = true | |
| $base = null | |
| $cacheAction = false | |
| $data = array() | |
| $ext = '.ctp' | |
| $field = null | |
| $fieldSuffix = null | |
| $hasRendered = false | |
| $helpers = array('Html') | |
| $here = null | |
| $layout = 'default' | |
| $layoutPath = null | |
| $loaded = array() | |
| $model = null | |
| $modelId = null | |
| $modelScope = false | |
| $name = null | |
| $output = false | |
| $pageTitle = false | |
| $params = array() | |
| $passedArgs = array() | |
| $plugin = null | |
| $subDir = null | |
| $themeWeb = null | |
| $uuids = array() | |
| $validationErrors = array() | |
| $viewPath = null | |
| $viewVars = array() | |
Definition at line 37 of file view.php.
| View::__construct | ( | &$ | controller, | |
| $ | register = true | |||
| ) |
| View::_getLayoutFileName | ( | $ | name = null |
) |
Returns layout filename for this template as a string.
Definition at line 838 of file view.php.
References $path, ext(), and underscore().
| View::_getViewFileName | ( | $ | name = null |
) |
Returns filename of given action's template file (.ctp) as a string. CamelCased action names will be under_scored! This means that you can have LongActionNames that refer to long_action_names.ctp views.
| string | $action Controller action to find template filename for |
Reimplemented in ScaffoldView.
Definition at line 780 of file view.php.
References $path, ext(), Configure::read(), and underscore().
| & View::_loadHelpers | ( | &$ | loaded, | |
| $ | helpers, | |||
| $ | parent = null | |||
| ) |
Loads helpers, with their dependencies.
| array | $loaded List of helpers that are already loaded. | |
| array | $helpers List of helpers to load. | |
| string | $parent holds name of helper, if loaded helper has helpers |
Definition at line 704 of file view.php.
References App::import(), params(), and underscore().
| View::_missingView | ( | $ | file, | |
| $ | error = 'missingView' | |||
| ) |
Return a misssing view error message
| string | $viewFileName the filename that should exist |
Definition at line 866 of file view.php.
References name().
Referenced by ScaffoldView::_getViewFileName().
| View::_paths | ( | $ | plugin = null, |
|
| $ | cached = true | |||
| ) |
Return all possible paths to find view files in order
| string | $plugin |
Reimplemented in ThemeView.
Definition at line 892 of file view.php.
References Configure::read().
| View::_render | ( | $ | ___viewFn, | |
| $ | ___dataForView, | |||
| $ | loadHelpers = true, |
|||
| $ | cached = false | |||
| ) |
Renders and returns output for given view filename with its array of data.
| string | $___viewFn Filename of the view | |
| array | $___dataForView Data to include in rendered view |
Definition at line 647 of file view.php.
References $out, cache(), name(), Configure::read(), and variable().
Referenced by render(), and renderLayout().
| View::_triggerHelpers | ( | $ | callback | ) |
| View::addScript | ( | $ | name, | |
| $ | content = null | |||
| ) |
| View::element | ( | $ | name, | |
| $ | params = array(), |
|||
| $ | loadHelpers = false | |||
| ) |
Renders a piece of PHP with provided parameters and returns HTML, XML, or any other string.
This realizes the concept of Elements, (or "partial layouts") and the $params array is used to send data to be used in the Element. Elements can be cached through use of the cache key.
| string | $name Name of template file in the/app/views/elements/ folder | |
| array | $params Array of data to be made available to the for rendered view (i.e. the Element) Special params: cache - enable caching for this element accepts boolean or strtotime compatible string. Can also be an array if an array,'time' is used to specify duration of cache. 'key' can be used to create unique cache files. |
Definition at line 298 of file view.php.
References $path, cache(), ext(), Configure::read(), and slug().
Referenced by renderLayout().
| View::entity | ( | ) |
Returns the entity reference of the current context as an array of identity parts
Definition at line 584 of file view.php.
References Set::filter().
| View::error | ( | $ | code, | |
| $ | name, | |||
| $ | message | |||
| ) |
Displays an error page to the user. Uses layouts/error.ctp to render the page.
| integer | $code HTTP Error code (for instance: 404) | |
| string | $name Name of the error (for instance: Not Found) | |
| string | $message Error message as a web page |
Definition at line 631 of file view.php.
References error(), and name().
Referenced by ScaffoldView::_getViewFileName().
| View::getVar | ( | $ | var | ) |
| View::getVars | ( | ) |
| View::render | ( | $ | action = null, |
|
| $ | layout = null, |
|||
| $ | file = null | |||
| ) |
Renders view for given action and layout. If $file is given, that is used for a view filename (e.g. customFunkyView.ctp).
| string | $action Name of action to render for | |
| string | $layout Layout to use | |
| string | $file Custom filename for view |
Definition at line 364 of file view.php.
References $out, __(), _render(), cache(), and Configure::read().
| View::renderCache | ( | $ | filename, | |
| $ | timeStart | |||
| ) |
Render cached view
| string | $filename the cache file to include | |
| string | $timeStart the page render start time |
Definition at line 497 of file view.php.
References $filename, $out, and Configure::read().
| View::renderElement | ( | $ | name, | |
| $ | params = array(), |
|||
| $ | loadHelpers = false | |||
| ) |
| View::renderLayout | ( | $ | content_for_layout, | |
| $ | layout = null | |||
| ) |
Renders a layout. Returns output from _render(). Returns false on error. Several variables are created for use in layout. title_for_layout - contains page title content_for_layout - contains rendered view file scripts_for_layout - contains scripts added to header cakeDebug - if debug is on, cake debug information is added.
| string | $content_for_layout Content to render in a view, wrapped by the surrounding layout. |
Definition at line 418 of file view.php.
References __(), _render(), element(), humanize(), and Configure::read().
| View::set | ( | $ | one, | |
| $ | two = null | |||
| ) |
Allows a template or element to set a variable that will be available in a layout or other element. Analagous to Controller::set.
| mixed | $one A string or an array of data. | |
| mixed | $two Value in case $one is a string (which then works as the key). Unused if $one is an associative array, otherwise serves as the values to $one's keys. |
| View::uuid | ( | $ | object, | |
| $ | url | |||
| ) |
Generates a unique, non-random DOM ID for an object, based on the object type and the target URL.
| string | $object Type of object, i.e. 'form' or 'link' | |
| string | $url The object's target URL |
Definition at line 568 of file view.php.
References $url, md5(), and Router::url().
| View::$__passedVars |
| View::$ext = '.ctp' |
| View::$name = null |
Definition at line 64 of file view.php.
Referenced by ScaffoldView::_getViewFileName(), and MediaView::render().
| View::$plugin = null |
| View::$subDir = null |
1.4.7