Joomla CMS  3.8.5 (avec JPlatform 13.1 inclus)
Documentation des API du CMS Joomla en version 3.8.5 et du framework Joomla Platform intégré
Référence de la classe FOFView
+ Graphe d'héritage de FOFView:

Fonctions membres publiques

 __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 ()
 
- Fonctions membres publiques hérités de FOFUtilsObject
 __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)
 

Fonctions membres publiques statiques

static registerRenderer (FOFRenderAbstract &$renderer)
 

Attributs publics statiques

static $renderers = array()
 

Fonctions membres protégées

 findRenderer ()
 
 _setPath ($type, $path)
 
 _addPath ($type, $path)
 
 _createFileName ($type, $parts=array())
 

Attributs protégés

 $_name = null
 
 $_models = array()
 
 $_basePath = null
 
 $_defaultModel = null
 
 $_layout = 'default'
 
 $_layoutExt = 'php'
 
 $_layoutTemplate = '_'
 
 $_path = array('template' => array(), 'helper' => array())
 
 $_template = null
 
 $_output = null
 
 $_escape = 'htmlspecialchars'
 
 $_charset = 'UTF-8'
 
 $config = array()
 
 $input = null
 
 $rendererObject = null
 
 $doPreRender = true
 
 $doPostRender = true
 
- Attributs protégés hérités de FOFUtilsObject
 $_errors = array()
 

Fonctions membres privées

 _parseTemplatePath ($path='')
 

Documentation des constructeurs et destructeur

◆ __construct()

__construct (   $config = array())

Public constructor. Instantiates a FOFView object.

Paramètres
array$configThe configuration data array

Références $component, $config, $input, $view, elseif, FOFPlatform\getInstance(), FOFInflector\isSingular(), null, FOFInflector\pluralize(), et FOFInflector\singularize().

Documentation des fonctions membres

◆ _addPath()

_addPath (   $type,
  $path 
)
protected

Adds to the search path for templates and resources.

Paramètres
string$typeThe type of path to add.
mixed$pathThe 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$typeThe resource type to create the filename for
array$partsAn 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$pathThe 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$typeThe type of path to set, typically 'template'.
mixed$pathThe 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()

addHelperPath (   $path)

Adds to the stack of helper script paths in LIFO order.

Paramètres
mixed$pathA directory path or an array of paths.
Renvoie
void

Références $path.

◆ addTemplatePath()

addTemplatePath (   $path)

Adds to the stack of view script paths in LIFO order.

Paramètres
mixed$pathA directory path or an array of paths.
Renvoie
void

Références $path.

◆ assign()

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$keyThe name for the reference in the view.
mixed&$valThe 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()

display (   $tpl = null)

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$tplThe name of the template file to parse
Renvoie
mixed A string if successful, otherwise a JError object.

Références FOFPlatform\getInstance().

◆ escape()

escape (   $var)

Escapes a value for output in a view script.

If escaping mechanism is either htmlspecialchars or htmlentities, uses $_encoding setting.

Paramètres
mixed$varThe output to escape.
Renvoie
mixed The escaped value.

Références ENT_COMPAT.

◆ findRenderer()

findRenderer ( )
protected

◆ get()

get (   $property,
  $default = null 
)

Method to get data from a registered model or a property of the view

Paramètres
string$propertyThe name of the method to call on the model or the property to get
string$defaultThe name of the model to reference or the default value [optional]
Renvoie
mixed The return value of the method

Références $default.

◆ getLayout()

getLayout ( )

Get the layout.

Renvoie
string The layout name

◆ getLayoutTemplate()

getLayoutTemplate ( )

Get the layout template.

Renvoie
string The layout template name

◆ getModel()

getModel (   $name = null)

Method to get the model object

Paramètres
string$nameThe name of the model (optional)
Renvoie
mixed FOFModel object

Références $name, et null.

◆ getName()

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()

& getRenderer ( )

Get the renderer object for this view

Renvoie
FOFRenderAbstract

◆ getViewOptionAndName()

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$pathSee above
array$forceParamsA 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$hlpThe 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 overriden function uses loadAnyTemplate to provide smarter view template loading.

Paramètres
string$tplThe name of the template file to parse
boolean$strictShould 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()

static registerRenderer ( FOFRenderAbstract $renderer)
static

Registers a renderer object with the view

Paramètres
FOFRenderAbstract&$rendererThe render object to register
Renvoie
void

Références $renderer.

◆ setEscape()

setEscape (   $spec)

Sets the _escape() callback.

Paramètres
mixed$specThe callback for _escape() to use.
Renvoie
void
Obsolète:
2.1 Override FOFView::escape() instead.

Références FOFPlatform\getInstance().

◆ setLayout()

setLayout (   $layout)

Sets the layout name to use

Paramètres
string$layoutThe layout name or a string in format <template>:<layout file>="">
Renvoie
string Previous value.

Références $layout.

◆ setLayoutExt()

setLayoutExt (   $value)

Allows a different extension for the layout files to be used

Paramètres
string$valueThe 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$modelThe model to add to the view.
boolean$defaultIs this the default model?
String$nameoptional index name to store the model
@return  object   The added model.

Références $default, et $name.

◆ setPostRender()

setPostRender (   $value)

Sets the post-render flag

Paramètres
boolean$valueTrue to enable the post-render step
Renvoie
void

Références $value.

◆ setPreRender()

setPreRender (   $value)

Sets the pre-render flag

Paramètres
boolean$valueTrue to enable the pre-render step
Renvoie
void

Références $value.

◆ setRenderer()

setRenderer ( FOFRenderAbstract $renderer)

Sets the renderer object for this view

Paramètres
FOFRenderAbstract&$rendererThe render class to use
Renvoie
void

Références $renderer.

Documentation des champs

◆ $_basePath

$_basePath = null
protected

◆ $_charset

$_charset = 'UTF-8'
protected

◆ $_defaultModel

$_defaultModel = null
protected

◆ $_escape

$_escape = 'htmlspecialchars'
protected

◆ $_layout

$_layout = 'default'
protected

◆ $_layoutExt

$_layoutExt = 'php'
protected

◆ $_layoutTemplate

$_layoutTemplate = '_'
protected

◆ $_models

$_models = array()
protected

◆ $_name

$_name = null
protected

◆ $_output

$_output = null
protected

◆ $_path

$_path = array('template' => array(), 'helper' => array())
protected

◆ $_template

$_template = null
protected

◆ $config

$config = array()
protected

◆ $doPostRender

$doPostRender = true
protected

◆ $doPreRender

$doPreRender = true
protected

◆ $input

$input = null
protected

◆ $rendererObject

$rendererObject = null
protected

◆ $renderers

$renderers = array()
static

La documentation de cette classe a été générée à partir du fichier suivant :