API Joomla 1.5.26
Documentation des API du CMS Joomla en version 1.5
|
JView::__construct | ( | $ | config = array() | ) |
Constructor
protected
Réimplémentée dans InstallerViewDefault, et ContentView.
Références $config, et JURI::base().
JView::_addPath | ( | $ | type, |
$ | path | ||
) |
JView::_createFileName | ( | $ | type, |
$ | parts = array() |
||
) |
JView::_setPath | ( | $ | type, |
$ | path | ||
) |
Sets an entire array of search paths for templates or resources.
protected
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. |
Références $mainframe, $option, $path, et $type.
JView::addHelperPath | ( | $ | path | ) |
Adds to the stack of helper script paths in LIFO order.
string|array | The directory (-ies) to add. |
Références $path.
JView::addTemplatePath | ( | $ | path | ) |
Adds to the stack of view script paths in LIFO order.
string|array | The directory (-ies) to add. |
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);
public
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 =& $var1;
public
string | $key | The name for the reference in the view. |
mixed | &$val | The referenced variable. |
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. |
object | An JError object. |
Réimplémentée dans InstallerViewComponents, InstallerViewDefault, InstallerViewInstall, InstallerViewLanguages, InstallerViewModules, InstallerViewPlugins, InstallerViewTemplates, MediaViewImages, MediaViewImagesList, MediaViewMedia, MediaViewMediaList, MenusViewList, MenusViewMenus, PluginsViewPlugin, PluginsViewPlugins, PollViewPoll, PollViewPolls, SearchViewSearch, UsersViewUser, UsersViewUsers, WeblinksViewWeblink, WeblinksViewWeblinks, ContactViewCategory, ContactViewContact, ContentViewArchive, ContentViewArticle, ContentViewArticle, ContentViewCategory, ContentViewFrontpage, ContentViewFrontpage, ContentViewSection, MailtoViewMailto, MailtoViewSent, NewsfeedsViewCategories, NewsfeedsViewCategory, NewsfeedsViewNewsfeed, PollViewPoll, SearchViewSearch, UserViewLogin, UserViewRegister, UserViewRemind, UserViewReset, UserViewUser, WeblinksViewCategories, WeblinksViewCategory, WeblinksViewCategory, WeblinksViewWeblink, et WrapperViewWrapper.
Références JError::isError().
JView::escape | ( | $ | var | ) |
Escapes a value for output in a view script.
If escaping mechanism is one of 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
public
string | The name of the method to call on the model, or the property to get |
string | The name of the model to reference, or the default value [optional] |
Réimplémentée à partir de JObject.
JView::getLayout | ( | ) |
Get the layout.
public
& 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
public
Références $name, JError::raiseError(), et JError::raiseWarning().
JView::loadHelper | ( | $ | hlp = null | ) |
Load a helper file
public
string | $tpl | 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
public
string | $tpl | The name of the template source file ... automatically searches the template paths and compiles as needed. |
Références $file, $mainframe, $option, JPath::find(), jimport(), et JError::raiseError().
JView::setEscape | ( | $ | spec | ) |
Sets the _escape() callback.
mixed | $spec | The callback for _escape() to use. |
JView::setLayout | ( | $ | layout | ) |
Sets the layout name to use
public
string | $template | The template name. |
Références $layout.
JView::setLayoutExt | ( | $ | value | ) |
Allows a different extension for the layout files to be used
public
string | 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.
public
object | $model | The model to add to the view. |
boolean | $default | Is this the default model? |
Références $name.
JView::$_basePath = null |
JView::$_charset = 'UTF-8' |
JView::$_defaultModel = null |
JView::$_escape = 'htmlspecialchars' |
JView::$_layout = 'default' |
JView::$_layoutExt = 'php' |
JView::$_models = array() |
JView::$_name = null |
Réimplémentée dans MenusViewItem, et MenusViewList.
JView::$_output = null |
JView::$_path |
array( 'template' => array(), 'helper' => array() )
JView::$_template = null |
Réimplémentée dans JInstallationView.