JView
Base class for a Joomla View
Class holding methods for displaying presentation data.
Located in /joomla/application/component/view.php (line 31)
JObject (Subpackage Base) JView (Subpackage Application)
The default model
Layout name
Registered models
The name of the view
'template' => array()) (line 71)
The set of search directories for resources (templates)
Constructor
- $config
- JObject::__construct()
- Class constructor, overridden in descendant classes.
Adds to the callbacks used when calling JView::escape().
Each parameter passed to this function is treated as a separate callback. For example:
- 'stripslashes',
- 'htmlspecialchars',
- array('StaticClass', 'method'),
- array($object, $method)
- );
Adds to the stack of view script paths in LIFO order.
- string|array $path: The directory (-ies) to add.
Assigns variables to the view script via differing strategies.
This method is overloaded; you can assign all the properties of an object, an associative array, or a single value by name.
You are not allowed to set variables that begin with an underscore; these are either private properties for JView or private variables within the template script itself.
- // assign directly
- $view->var1 = 'something';
- $view->var2 = 'else';
- // assign by name and value
- // assign by assoc-array
- $ary = array('var1' => 'something', 'var2' => 'else');
- // assign by object
- $obj = new stdClass;
- $obj->var1 = 'something';
- $obj->var2 = 'else';
Assign variable for the view (by reference).
You are not allowed to set variables that begin with an underscore; these are either private properties for JView or private variables within the template script itself.
- // assign by name and value
- // assign directly
- $view->ref =& $var1;
- string $key: The name for the reference in the view.
- mixed &$val: The referenced variable.
Execute and display a template script.
- string $tpl: The name of the template file to parse; automatically searches through the template paths.
Applies escaping to a value.
You can override the predefined escaping callbacks by passing added parameters as replacement callbacks.
- // use predefined callbacks
- // use replacement callbacks
- $value,
- 'stripslashes',
- 'htmlspecialchars',
- array('StaticClass', 'method'),
- array($object, $method)
- );
- mixed $value: The value to be escaped.
Method to get data from a registered model
- string $method: The name of the method to call on the model
- string $model: The name of the model to reference [optional]
- JObject::get()
- Returns a property of the object or the default value if the property is not set.
Method to get the model object
- string $name: The name of the model (optional)
Load a template file -- first look in the templates folder for an override
- string $_tpl: The name of the template source file ... automatically searches the template paths and compiles as needed.
- $tpl
Clears then sets the callbacks to use when calling JView::escape().
Each parameter passed to this function is treated as a separate callback. For example:
- 'stripslashes',
- 'htmlspecialchars',
- array('StaticClass', 'method'),
- array($object, $method)
- );
Sets the layout name to use
- string $template: The template name.
- $layout
Method to add a model to the view. We support a multiple model single
view system by which models are referenced by classname. A caveat to the classname referencing is that any classname prepended by JModel will be referenced by the name without JModel, eg. JModelCategory is just Category.
- object $model: The model to add to the view.
- boolean $default: Is this the default model?
- &$model
Adds to the search path for templates and resources.
- string|array $path: The directory or stream to search.
- $type
Sets an entire array of search paths for templates or resources.
- string $type: The type of path to set, typically 'template'.
- string|array $path: The new set of search paths. If null or false, resets to the current directory only.
Inherited Methods
Inherited From JObject
JObject::JObject()
JObject::__construct()
JObject::get()
JObject::getPublicProperties()
JObject::set()
JObject::toString()
Documentation generated on Mon, 05 Mar 2007 21:31:28 +0000 by phpDocumentor 1.3.1