Joomla CMS  2.5.24 (avec JPlatform 11.4 inclus)
Documentation des API du CMS Joomla en version 2.5 et du framework Joomla Platform intégré
 Tout Classes Espaces de nommage Fichiers Fonctions Variables Pages
Référence de la classe JView
+ Graphe d'héritage de JView:
+ Graphe de collaboration de JView:

Liste de tous les membres

Fonctions membres publiques

 __construct ($config=array())
 display ($tpl=null)
 assign ()
 assignRef ($key, &$val)
 escape ($var)
 get ($property, $default=null)
 getModel ($name=null)
 getLayout ()
 getLayoutTemplate ()
 getName ()
 setModel (&$model, $default=false)
 setLayout ($layout)
 setLayoutExt ($value)
 setEscape ($spec)
 addTemplatePath ($path)
 addHelperPath ($path)
 loadTemplate ($tpl=null)
 loadHelper ($hlp=null)
- Fonctions membres publiques inherited from JObject
 __toString ()
 def ($property, $default=null)
 getProperties ($public=true)
 getError ($i=null, $toString=true)
 getErrors ()
 set ($property, $value=null)
 setProperties ($properties)
 setError ($error)
 toString ()

Fonctions membres protégées

 _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'
- Attributs protégés inherited from JObject
 $_errors = array()

Documentation des constructeurs et destructeur

JView::__construct (   $config = array())

Constructor

Paramètres:
array$configA named configuration array for object construction.
name: the name (optional) of the view (defaults to the view class name suffix).
charset: the character set to use for display
escape: the name (optional) of the function to use for escaping strings
base_path: the parent path (optional) of the views directory (defaults to the component folder)
template_plath: the path (optional) of the layout directory (defaults to base_path + /views/ + view name
helper_path: the path (optional) of the helper files (defaults to base_path + /helpers/)
layout: the layout (optional) to use to display the view
Depuis:
11.1

Réimplémentée à partir de JObject.

Réimplémentée dans InstallerViewDefault.

Références $config, et JURI\base().

+ Voici le graphe d'appel pour cette fonction :


Documentation des fonctions membres

JView::_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
Depuis:
11.1

Références $path, $type, et DIRECTORY_SEPARATOR.

JView::_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
Depuis:
11.1

Références $parts, et $type.

JView::_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
Depuis:
11.1

Références $app, $path, $type, JFactory\getApplication(), JApplicationHelper\getComponentName(), et JPATH_THEMES.

+ Voici le graphe d'appel pour cette fonction :

JView::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
Depuis:
11.1

Références $path.

JView::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
Depuis:
11.1

Références $path.

JView::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 JView or private variables within the template script itself.

$view = new JView;

// Assign directly $view->var1 = 'something'; $view->var2 = 'else';

// Assign by name and value $view->assign('var1', 'something'); $view->assign('var2', 'else');

// Assign by assoc-array $ary = array('var1' => 'something', 'var2' => 'else'); $view->assign($obj);

// Assign by object $obj = new stdClass; $obj->var1 = 'something'; $obj->var2 = 'else'; $view->assign($obj);

Renvoie:
boolean True on success, false on failure.

Références $key.

JView::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 JView or private variables within the template script itself.

$view = new JView;

// Assign by name and value $view->assignRef('var1', $ref);

// Assign directly $view->ref =

Paramètres:
string$keyThe name for the reference in the view.
mixed&$valThe referenced variable.
Renvoie:
boolean True on success, false on failure.
Depuis:
11.1

Références $key.

JView::display (   $tpl = null)

Execute and display a template script.

Paramètres:
string$tplThe name of the template file to parse; automatically searches through the template paths.
Renvoie:
mixed A string if successful, otherwise a JError object.
Voir également:
fetch()
Depuis:
11.1

Réimplémentée dans UsersViewNotes, UsersViewNote, LanguagesViewOverride, LanguagesViewOverrides, LanguagesViewInstalled, AdminViewHelp, InstallerViewLanguages, TemplatesViewTemplates, NewsfeedsViewNewsfeed, AdminViewSysinfo, BannersViewBanners, FinderViewSearch, InstallerViewDefault, ContentViewFeatured, FinderViewIndex, FinderViewMaps, FinderViewSearch, MenusViewItems, ContactViewFeatured, ContentViewCategory, UsersViewLogin, UsersViewProfile, UsersViewRegistration, FinderViewFilter, FinderViewFilters, FinderViewIndexer, FinderViewStatistics, InstallerViewManage, JoomlaupdateViewDefault, TemplatesViewPrevuuw, FinderViewSearch, UsersViewRemind, UsersViewReset, ContactViewContacts, ContentViewArticles, JoomlaupdateViewUpdate, ModulesViewModule, RedirectViewLinks, ContactViewCategories, BannersViewBanner, BannersViewClient, RedirectViewLink, TemplatesViewSource, UsersViewMail, ContactViewContact, ContentViewCategories, NewsfeedsViewCategories, WeblinksViewCategories, CacheViewCache, MenusViewItem, MenusViewMenus, SearchViewSearches, UsersViewDebugGroup, UsersViewDebugUser, ContactViewCategory, NewsfeedsViewCategory, WeblinksViewCategory, JInstallationViewPreinstall, BannersViewClients, BannersViewTracks, CategoriesViewCategories, CategoriesViewCategory, ContactViewContact, ContentViewArticle, CpanelViewCpanel, InstallerViewDatabase, InstallerViewDiscover, LanguagesViewLanguage, LanguagesViewLanguages, MenusViewMenu, MessagesViewConfig, MessagesViewMessages, ModulesViewModules, NewsfeedsViewNewsfeed, NewsfeedsViewNewsfeeds, PluginsViewPlugin, PluginsViewPlugins, TemplatesViewStyle, TemplatesViewStyles, TemplatesViewTemplate, UsersViewGroup, UsersViewGroups, UsersViewLevel, UsersViewLevels, UsersViewUsers, WeblinksViewWeblink, WeblinksViewWeblinks, ConfigViewApplication, InstallerViewInstall, InstallerViewUpdate, ModulesViewSelect, UsersViewUser, ContentViewArticle, CheckinViewCheckin, ConfigViewClose, InstallerViewWarnings, ModulesViewPositions, ContentViewArchive, ContentViewForm, SearchViewSearch, WeblinksViewForm, AdminViewProfile, BannersViewDownload, ContentViewFeatured, MessagesViewMessage, JInstallationViewComplete, JInstallationViewDatabase, JInstallationViewFilesystem, JInstallationViewLanguage, JInstallationViewLicense, JInstallationViewSite, BannersViewTracks, CacheViewPurge, LanguagesViewMultilangstatus, MenusViewMenutypes, ModulesViewPreview, SearchViewSearch, WeblinksViewCategory, WeblinksViewWeblink, ConfigViewComponent, ContactViewCategory, MediaViewImages, MediaViewImagesList, MediaViewMedia, MediaViewMediaList, ContentViewCategory, ContentViewFeatured, WrapperViewWrapper, MailtoViewMailto, et MailtoViewSent.

JView::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.
Depuis:
11.1
JView::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
Depuis:
11.1

Réimplémentée à partir de JObject.

JView::getLayout ( )

Get the layout.

Renvoie:
string The layout name
JView::getLayoutTemplate ( )

Get the layout template.

Renvoie:
string The layout template name
JView::getModel (   $name = null)

Method to get the model object

Paramètres:
string$nameThe name of the model (optional)
Renvoie:
mixed JModel object
Depuis:
11.1

Références $name, et null.

JView::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
Depuis:
11.1

Références JText\_(), null, JError\raiseError(), et JError\raiseWarning().

+ Voici le graphe d'appel pour cette fonction :

JView::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
Depuis:
11.1

Références $file, JPath\find(), et jimport().

+ Voici le graphe d'appel pour cette fonction :

JView::loadTemplate (   $tpl = null)

Load a template file – first look in the templates folder for an override

Paramètres:
string$tplThe name of the template source file; automatically searches the template paths and compiles as needed.
Renvoie:
string The output of the the template script.
Depuis:
11.1

Références $file, $lang, $layout, $template, JPath\find(), JFactory\getApplication(), JFactory\getLanguage(), jimport(), JPATH_BASE, JPATH_THEMES, null, JError\raiseError(), et JText\sprintf().

+ Voici le graphe d'appel pour cette fonction :

JView::setEscape (   $spec)

Sets the _escape() callback.

Paramètres:
mixed$specThe callback for _escape() to use.
Renvoie:
void
Depuis:
11.1
JView::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.
Depuis:
11.1

Références $layout.

JView::setLayoutExt (   $value)

Allows a different extension for the layout files to be used

Paramètres:
string$valueThe extension.
Renvoie:
string Previous value
Depuis:
11.1
JView::setModel ( $model,
  $default = false 
)

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.

Paramètres:
JModel&$modelThe model to add to the view.
boolean$defaultIs this the default model?
Renvoie:
object The added model.
Depuis:
11.1

Références $name.


Documentation des données membres

JView::$_basePath = null
protected
JView::$_charset = 'UTF-8'
protected
JView::$_defaultModel = null
protected
JView::$_escape = 'htmlspecialchars'
protected
JView::$_layout = 'default'
protected
JView::$_layoutExt = 'php'
protected
JView::$_layoutTemplate = '_'
protected
JView::$_models = array()
protected
JView::$_name = null
protected
JView::$_output = null
protected
JView::$_path = array('template' => array(), 'helper' => array())
protected
JView::$_template = null
protected

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