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é
|
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() |
JView::__construct | ( | $config = array() | ) |
Constructor
array | $config | A 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 |
Réimplémentée à partir de JObject.
Réimplémentée dans InstallerViewDefault.
Références $config, et JURI\base().
|
protected |
Adds to the search path for templates and resources.
string | $type | The type of path to add. |
mixed | $path | The directory or stream, or an array of either, to search. |
Références $path, $type, et DIRECTORY_SEPARATOR.
|
protected |
|
protected |
Sets an entire array of search paths for templates or resources.
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. |
Références $app, $path, $type, JFactory\getApplication(), JApplicationHelper\getComponentName(), et JPATH_THEMES.
JView::addHelperPath | ( | $path | ) |
Adds to the stack of helper script paths in LIFO order.
mixed | $path | A directory path or an array of paths. |
Références $path.
JView::addTemplatePath | ( | $path | ) |
Adds to the stack of view script paths in LIFO order.
mixed | $path | A directory path or an array of paths. |
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);
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 =
string | $key | The name for the reference in the view. |
mixed | &$val | The referenced variable. |
Références $key.
JView::display | ( | $tpl = null | ) |
Execute and display a template script.
string | $tpl | The name of the template file to parse; automatically searches through the template paths. |
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.
mixed | $var | The output to escape. |
JView::get | ( | $property, | |
$default = null |
|||
) |
Method to get data from a registered model or a property of the view
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] |
Réimplémentée à partir de JObject.
JView::getLayout | ( | ) |
Get the layout.
JView::getLayoutTemplate | ( | ) |
Get the layout template.
JView::getModel | ( | $name = 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
Références JText\_(), null, JError\raiseError(), et JError\raiseWarning().
JView::loadHelper | ( | $hlp = null | ) |
Load a helper file
string | $hlp | The name of the helper source file automatically searches the helper paths and compiles as needed. |
Références $file, JPath\find(), et jimport().
JView::loadTemplate | ( | $tpl = null | ) |
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. |
Références $file, $lang, $layout, $template, JPath\find(), JFactory\getApplication(), JFactory\getLanguage(), jimport(), JPATH_BASE, JPATH_THEMES, null, JError\raiseError(), et JText\sprintf().
JView::setEscape | ( | $spec | ) |
Sets the _escape() callback.
mixed | $spec | The callback for _escape() to use. |
JView::setLayout | ( | $layout | ) |
Sets the layout name to use
string | $layout | The layout name or a string in format <template>:<layout file>=""> |
Références $layout.
JView::setLayoutExt | ( | $value | ) |
Allows a different extension for the layout files to be used
string | $value | The extension. |
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.
JModel | &$model | The model to add to the view. |
boolean | $default | Is this the default model? |
Références $name.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |