|
| __construct ($config=array()) |
|
| loadAnyTemplate ($path='', $forceParams=array()) |
|
| display ($tpl=null) |
|
| assign () |
|
| assignRef ($key, &$val) |
|
| escape ($var) |
|
| get ($property, $default=null) |
|
| getModel ($name=null) |
|
| getLayout () |
|
| getLayoutTemplate () |
|
| getName () |
|
| setModel ($model, $default=false, $name=null) |
|
| setLayout ($layout) |
|
| setLayoutExt ($value) |
|
| setEscape ($spec) |
|
| addTemplatePath ($path) |
|
| addHelperPath ($path) |
|
| loadTemplate ($tpl=null, $strict=false) |
|
& | getRenderer () |
|
| setRenderer (FOFRenderAbstract &$renderer) |
|
| setPreRender ($value) |
|
| setPostRender ($value) |
|
| loadHelper ($hlp=null) |
|
| getViewOptionAndName () |
|
| __construct ($properties=null) |
|
| __toString () |
|
| def ($property, $default=null) |
|
| get ($property, $default=null) |
|
| getProperties ($public=true) |
|
| getError ($i=null, $toString=true) |
|
| getErrors () |
|
| set ($property, $value=null) |
|
| setProperties ($properties) |
|
| setError ($error) |
|
◆ __construct()
__construct |
( |
|
$config = array() | ) |
|
◆ _addPath()
_addPath |
( |
|
$type, |
|
|
|
$path |
|
) |
| |
|
protected |
Adds to the search path for templates and resources.
- Paramètres
-
string | $type | The type of path to add. |
mixed | $path | The directory or stream, or an array of either, to search. |
- Renvoie
- void
Références $path, $type, et DIRECTORY_SEPARATOR.
◆ _createFileName()
_createFileName |
( |
|
$type, |
|
|
|
$parts = array() |
|
) |
| |
|
protected |
Create the filename for a resource
- Paramètres
-
string | $type | The resource type to create the filename for |
array | $parts | An associative array of filename information |
- Renvoie
- string The filename
Références $parts, et $type.
◆ _parseTemplatePath()
_parseTemplatePath |
( |
|
$path = '' | ) |
|
|
private |
Parses a template path in the form of admin:/component/view/layout or site:/component/view/layout to an array which can be used by loadAnyTemplate to locate and load the view template file.
- Paramètres
-
string | $path | The template path to parse |
- Renvoie
- array A hash array with the parsed path parts
Références $parts, $path, et elseif.
◆ _setPath()
_setPath |
( |
|
$type, |
|
|
|
$path |
|
) |
| |
|
protected |
Sets an entire array of search paths for templates or resources.
- Paramètres
-
string | $type | The type of path to set, typically 'template'. |
mixed | $path | The new search path, or an array of search paths. If null or false, resets to the current directory only. |
- Renvoie
- void
Références $path, $type, et FOFPlatform\getInstance().
◆ addHelperPath()
Adds to the stack of helper script paths in LIFO order.
- Paramètres
-
mixed | $path | A directory path or an array of paths. |
- Renvoie
- void
Références $path.
◆ addTemplatePath()
Adds to the stack of view script paths in LIFO order.
- Paramètres
-
mixed | $path | A directory path or an array of paths. |
- Renvoie
- void
Références $path.
◆ assign()
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 FOFView or private variables within the template script itself.
- Renvoie
- boolean True on success, false on failure.
- Obsolète:
- 13.3 Use native PHP syntax.
Références $key, et FOFPlatform\getInstance().
◆ assignRef()
assignRef |
( |
|
$key, |
|
|
& |
$val |
|
) |
| |
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 FOFView or private variables within the template script itself.
- Paramètres
-
string | $key | The name for the reference in the view. |
mixed | &$val | The referenced variable. |
- Renvoie
- boolean True on success, false on failure.
- Obsolète:
- 13.3 Use native PHP syntax.
Références $key, et FOFPlatform\getInstance().
◆ display()
Overrides the default method to execute and display a template script. Instead of loadTemplate is uses loadAnyTemplate which allows for automatic Joomla! version overrides. A little slice of awesome pie!
- Paramètres
-
string | $tpl | The name of the template file to parse |
- Renvoie
- mixed A string if successful, otherwise a JError object.
Références FOFPlatform\getInstance().
◆ escape()
Escapes a value for output in a view script.
If escaping mechanism is either htmlspecialchars or htmlentities, uses $_encoding setting.
- Paramètres
-
mixed | $var | The output to escape. |
- Renvoie
- mixed The escaped value.
Références ENT_COMPAT.
◆ findRenderer()
◆ get()
get |
( |
|
$property, |
|
|
|
$default = null |
|
) |
| |
Method to get data from a registered model or a property of the view
- Paramètres
-
string | $property | The name of the method to call on the model or the property to get |
string | $default | The name of the model to reference or the default value [optional] |
- Renvoie
- mixed The return value of the method
Références $default.
◆ getLayout()
Get the layout.
- Renvoie
- string The layout name
◆ getLayoutTemplate()
Get the layout template.
- Renvoie
- string The layout template name
◆ getModel()
Method to get the model object
- Paramètres
-
string | $name | The name of the model (optional) |
- Renvoie
- mixed FOFModel object
Références $name, et null.
◆ getName()
Method to get the view name
The model name by default parsed using the classname, or it can be set by passing a $config['name'] in the class constructor
- Renvoie
- string The name of the model
◆ getRenderer()
◆ getViewOptionAndName()
Returns the view's option (component name) and view name in an associative array.
- Renvoie
- array
◆ loadAnyTemplate()
loadAnyTemplate |
( |
|
$path = '' , |
|
|
|
$forceParams = array() |
|
) |
| |
Loads a template given any path. The path is in the format:
e.g. admin:com_foobar/myview/default
This function searches for Joomla! version override templates. For example, if you have run this under Joomla! 3.0 and you try to load admin:com_foobar/myview/default it will automatically search for the template files default.j30.php, default.j3.php and default.php, in this order.
- Paramètres
-
string | $path | See above |
array | $forceParams | A hash array of variables to be extracted in the local scope of the template file |
- Renvoie
- boolean False if loading failed
Références $path, $suffix, $template, elseif, et FOFPlatform\getInstance().
◆ loadHelper()
loadHelper |
( |
|
$hlp = null | ) |
|
Load a helper file
- Paramètres
-
string | $hlp | The name of the helper source file automatically searches the helper paths and compiles as needed. |
- Renvoie
- void
Références $file, $path, et FOFPlatform\getInstance().
◆ loadTemplate()
loadTemplate |
( |
|
$tpl = null , |
|
|
|
$strict = false |
|
) |
| |
Overrides the built-in loadTemplate function with an FOF-specific one. Our overridden function uses loadAnyTemplate to provide smarter view template loading.
- Paramètres
-
string | $tpl | The name of the template file to parse |
boolean | $strict | Should we use strict naming, i.e. force a non-empty $tpl? |
- Renvoie
- mixed A string if successful, otherwise a JError object
Références $path, et FOFPlatform\getInstance().
◆ registerRenderer()
Registers a renderer object with the view
- Paramètres
-
- Renvoie
- void
Références $renderer.
◆ setEscape()
◆ setLayout()
Sets the layout name to use
- Paramètres
-
string | $layout | The layout name or a string in format <template>:<layout file>=""> |
- Renvoie
- string Previous value.
Références $layout.
◆ setLayoutExt()
Allows a different extension for the layout files to be used
- Paramètres
-
string | $value | The extension. |
- Renvoie
- string Previous value
Références $value.
◆ setModel()
setModel |
( |
|
$model, |
|
|
|
$default = false , |
|
|
|
$name = null |
|
) |
| |
Method to add a model to the view.
- Paramètres
-
FOFMOdel | $model | The model to add to the view. |
boolean | $default | Is this the default model? |
String | $name | optional index name to store the model @return object The added model. |
Références $default, et $name.
◆ setPostRender()
Sets the post-render flag
- Paramètres
-
boolean | $value | True to enable the post-render step |
- Renvoie
- void
Références $value.
◆ setPreRender()
Sets the pre-render flag
- Paramètres
-
boolean | $value | True to enable the pre-render step |
- Renvoie
- void
Références $value.
◆ setRenderer()
Sets the renderer object for this view
- Paramètres
-
- Renvoie
- void
Références $renderer.
◆ $_basePath
◆ $_charset
◆ $_defaultModel
◆ $_escape
◆ $_layout
◆ $_layoutExt
◆ $_layoutTemplate
◆ $_models
◆ $_name
◆ $_output
◆ $_path
$_path = array('template' => array(), 'helper' => array()) |
|
protected |
◆ $_template
◆ $config
◆ $doPostRender
◆ $doPreRender
◆ $input
◆ $rendererObject
◆ $renderers
La documentation de cette classe a été générée à partir du fichier suivant :