Class JViewLegacy

Description

Base class for a Joomla View

Class holding methods for displaying presentation data.

  • since: 12.2

Located in /libraries/legacy/view/legacy.php (line 21)

JObject
   |
   --JViewLegacy
Direct descendents
Class Description
 class AdminViewHelp HTML View class for the Admin component
 class AdminViewProfile View class to allow users edit their own profile.
 class AdminViewSysinfo Sysinfo View class for the Admin component
 class BannersViewBanner View to edit a banner.
 class BannersViewBanners View class for a list of banners.
 class BannersViewClient View to edit a client.
 class BannersViewClients View class for a list of clients.
 class BannersViewDownload View class for download a list of tracks.
 class View class for a list of tracks.
 class CacheViewCache HTML View class for the Cache component
 class CacheViewPurge HTML View class for the Cache component
 class CategoriesViewCategories Categories view class for the Category package.
 class CategoriesViewCategory HTML View class for the Categories component
 class CheckinViewCheckin HTML View class for the Checkin component
 class
 class ContactViewContacts View class for a list of contacts.
 class ContentViewArticle HTML Article View class for the Content component
 class ContentViewArticles View class for a list of articles.
 class Frontpage View class
 class ContenthistoryViewCompare View class for a list of contenthistory.
 class ContenthistoryViewHistory View class for a list of contenthistory.
 class ContenthistoryViewPreview View class for a list of contenthistory.
 class CpanelViewCpanel HTML View class for the Cpanel component
 class FinderViewFilter Filter view class for Finder.
 class FinderViewFilters Filters view class for Finder.
 class FinderViewIndex Index view class for Finder.
 class FinderViewIndexer Indexer view class for Finder.
 class FinderViewMaps Groups view class for Finder.
 class FinderViewStatistics Statistics view class for Finder.
 class InstallerViewDefault Extension Manager Default View
 class JoomlaupdateViewDefault Joomla! Update's Default View
 class JoomlaupdateViewUpdate Joomla! Update's Update View
 class LanguagesViewInstalled Displays a list of the installed languages.
 class LanguagesViewLanguage HTML View class for the Languages component
 class LanguagesViewLanguages HTML Languages View class for the Languages component
 class LanguagesViewMultilangstatus Displays the multilang status.
 class LanguagesViewOverride View to edit an language override
 class LanguagesViewOverrides View for language overrides list
 class LoginViewLogin HTML View class for the Login component
 class MediaViewImages HTML View class for the Media component
 class MediaViewImagesList HTML View class for the Media component
 class MediaViewMedia HTML View class for the Media component
 class MediaViewMediaList HTML View class for the Media component
 class MenusViewItem The HTML Menus Menu Item View.
 class MenusViewItems The HTML Menus Menu Items View.
 class MenusViewMenu The HTML Menus Menu Item View.
 class MenusViewMenus The HTML Menus Menu Menus View.
 class MenusViewMenutypes The HTML Menus Menu Item TYpes View.
 class MessagesViewConfig View to edit messages user configuration.
 class MessagesViewMessage HTML View class for the Messages component
 class MessagesViewMessages View class for a list of messages.
 class ModulesViewModule View to edit a module.
 class ModulesViewModules View class for a list of modules.
 class ModulesViewPositions
 class ModulesViewPreview HTML View class for the Modules component
 class ModulesViewSelect HTML View class for the Modules component
 class NewsfeedsViewNewsfeed HTML View class for the Newsfeeds component
 class NewsfeedsViewNewsfeeds View class for a list of newsfeeds.
 class PluginsViewPlugin View to edit a plugin.
 class PluginsViewPlugins View class for a list of plugins.
 class RedirectViewLink View to edit a redirect link.
 class RedirectViewLinks View class for a list of redirection links.
 class SearchViewSearches View class for a list of search terms.
 class HTML View class for the Tags component
 class HTML View class for the Tags component
 class View to edit a template style.
 class TemplatesViewStyles View class for a list of template styles.
 class TemplatesViewTemplate View to edit a template style.
 class TemplatesViewTemplates View class for a list of template styles.
 class UsersViewDebuggroup View class for a list of users.
 class UsersViewDebuguser View class for a list of users.
 class UsersViewGroup View to edit a user group.
 class UsersViewGroups View class for a list of user groups.
 class UsersViewLevel View to edit a user view level.
 class UsersViewLevels The HTML Users access levels view.
 class UsersViewMail Users mail view.
 class UsersViewNote User note edit view
 class UsersViewNotes User notes list view
 class UsersViewUser
 class UsersViewUsers View class for a list of users.
 class WeblinksViewWeblink HTML View class for the WebLinks component
 class WeblinksViewWeblinks View class for a list of weblinks.
 class ContactViewFeatured Frontpage View class
 class ContentViewArchive HTML View class for the Content component
 class ContentViewForm HTML Article View class for the Content component
 class OpenSearch View class for Finder
 class MailtoViewMailto
 class MailtoViewSent
 class OpenSearch View class for the Search component
 class UsersViewLogin Login view class for Users.
 class UsersViewProfile Profile view class for Users.
 class UsersViewRegistration Registration view class for Users.
 class UsersViewRemind Registration view class for Users.
 class UsersViewReset Reset view class for Users.
 class WeblinksViewForm HTML Article View class for the Weblinks component
 class WrapperViewWrapper
 class JViewCategories Categories view base class.
 class JViewCategory Base HTML View class for the a Category list
 class JViewCategoryfeed Base feed View class for a category
Variable Summary
 string $_basePath
 string $_charset
 string $_escape
 string $_layout
 string $_layoutExt
 array $_models
 array $_name
 string $_output
 array $_path
 string $_template
Method Summary
 JViewLegacy __construct ([array $config = array()])
 void addHelperPath (mixed $path)
 void addTemplatePath (mixed $path)
 boolean assign ()
 boolean assignRef (string $key, mixed &$val)
 mixed display ([string $tpl = null])
 mixed escape (mixed $var)
 mixed get (string $property, [string $default = null])
 mixed getForm ()
 string getLayout ()
 string getLayoutTemplate ()
 mixed getModel ([string $name = null])
 string getName ()
 void loadHelper ([string $hlp = null])
 string loadTemplate ([string $tpl = null])
 void setEscape (mixed $spec)
 string setLayout (string $layout)
 string setLayoutExt (string $value)
 object The setModel (JModelLegacy $model, [boolean $default = false])
 void _addPath (string $type, mixed $path)
 string _createFileName (string $type, [array $parts = array()])
 void _setPath (string $type, mixed $path)
Variables
string $_basePath = null (line 42)

The base path of the view

  • access: protected
string $_charset = 'UTF-8' (line 106)

Charset to use in escaping mechanisms; defaults to urf8 (UTF-8)

  • access: protected
string $_defaultModel = null (line 49)

The default model

  • access: protected
string $_escape = 'htmlspecialchars' (line 99)

Callback for escaping.

  • deprecated: 13.3
  • access: protected
string $_layout = 'default' (line 56)

Layout name

  • access: protected
string $_layoutExt = 'php' (line 63)

Layout extension

  • access: protected
string $_layoutTemplate = '_' (line 70)

Layout template

  • access: protected
array $_models = array() (line 35)

Registered models

  • access: protected
array $_name = null (line 28)

The name of the view

  • access: protected
string $_output = null (line 91)

The output of the template script.

  • access: protected
array $_path = array('template' => array(),'helper'=>array()) (line 77)

The set of search directories for resources (templates)

  • access: protected
string $_template = null (line 84)

The name of the default template source file.

  • access: protected

Inherited Variables

Inherited from JObject

JObject::$_errors
Methods
Constructor __construct (line 122)

Constructor

  • since: 12.2
  • access: public
JViewLegacy __construct ([array $config = array()])
  • 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

Redefinition of:
JObject::__construct()
Class constructor, overridden in descendant classes.

Redefined in descendants as:
addHelperPath (line 592)

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

  • since: 12.2
  • access: public
void addHelperPath (mixed $path)
  • mixed $path: A directory path or an array of paths.
addTemplatePath (line 578)

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

  • since: 12.2
  • access: public
void addTemplatePath (mixed $path)
  • mixed $path: A directory path or an array of paths.
assign (line 257)

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.

  1.  $view new JView;
  2.  
  3.  // Assign directly
  4.  $view->var1 'something';
  5.  $view->var2 'else';
  6.  
  7.  // Assign by name and value
  8.  $view->assign('var1''something');
  9.  $view->assign('var2''else');
  10.  
  11.  // Assign by assoc-array
  12.  $ary array('var1' => 'something''var2' => 'else');
  13.  $view->assign($obj);
  14.  
  15.  // Assign by object
  16.  $obj new stdClass;
  17.  $obj->var1 'something';
  18.  $obj->var2 'else';
  19.  $view->assign($obj);

  • return: True on success, false on failure.
  • deprecated: 13.3 Use native PHP syntax.
  • access: public
boolean assign ()
assignRef (line 331)

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.

  1.  $view new JView;
  2.  
  3.  // Assign by name and value
  4.  $view->assignRef('var1'$ref);
  5.  
  6.  // Assign directly
  7.  $view->ref &$var1;

  • return: True on success, false on failure.
  • deprecated: 13.3 Use native PHP syntax.
  • since: 12.2
  • access: public
boolean assignRef (string $key, mixed &$val)
  • string $key: The name for the reference in the view.
  • mixed &$val: The referenced variable.
display (line 209)

Execute and display a template script.

mixed display ([string $tpl = null])
  • string $tpl: The name of the template file to parse; automatically searches through the template paths.

Redefined in descendants as:
escape (line 356)

Escapes a value for output in a view script.

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

  • return: The escaped value.
  • since: 12.2
  • access: public
mixed escape (mixed $var)
  • mixed $var: The output to escape.
get (line 376)

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

  • return: The return value of the method
  • since: 12.2
  • access: public
mixed get (string $property, [string $default = null])
  • 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]

Redefinition of:
JObject::get()
Returns a property of the object or the default value if the property is not set.
getForm (line 804)

Returns the form object

  • return: A JForm object on success, false on failure
  • since: 3.2
  • access: public
mixed getForm ()
getLayout (line 433)

Get the layout.

  • return: The layout name
  • access: public
string getLayout ()
getLayoutTemplate (line 443)

Get the layout template.

  • return: The layout template name
  • access: public
string getLayoutTemplate ()
getModel (line 419)

Method to get the model object

  • return: JModelLegacy object
  • since: 12.2
  • access: public
mixed getModel ([string $name = null])
  • string $name: The name of the model (optional)
getName (line 459)

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

  • return: The name of the model
  • since: 12.2
  • throws: Exception
  • access: public
string getName ()
loadHelper (line 687)

Load a helper file

  • since: 12.2
  • access: public
void loadHelper ([string $hlp = null])
  • string $hlp: The name of the helper source file automatically searches the helper paths and compiles as needed.
loadTemplate (line 607)

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

  • return: The output of the the template script.
  • since: 12.2
  • throws: Exception
  • access: public
string loadTemplate ([string $tpl = null])
  • string $tpl: The name of the template source file; automatically searches the template paths and compiles as needed.
setEscape (line 562)

Sets the _escape() callback.

  • deprecated: 13.3 Override JViewLegacy::escape() instead.
  • since: 12.2
  • access: public
void setEscape (mixed $spec)
  • mixed $spec: The callback for _escape() to use.
setLayout (line 512)

Sets the layout name to use

  • return: Previous value.
  • since: 12.2
  • access: public
string setLayout (string $layout)
  • string $layout: The layout name or a string in format <template>:<layout file>
setLayoutExt (line 541)

Allows a different extension for the layout files to be used

  • return: Previous value
  • since: 12.2
  • access: public
string setLayoutExt (string $value)
  • string $value: The extension.
setModel (line 491)

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.

  • return: added model.
  • since: 12.2
  • access: public
object The setModel (JModelLegacy $model, [boolean $default = false])
  • JModelLegacy $model: The model to add to the view.
  • boolean $default: Is this the default model?
_addPath (line 749)

Adds to the search path for templates and resources.

  • since: 12.2
  • access: protected
void _addPath (string $type, mixed $path)
  • string $type: The type of path to add.
  • mixed $path: The directory or stream, or an array of either, to search.
_createFileName (line 782)

Create the filename for a resource

  • return: The filename
  • since: 12.2
  • access: protected
string _createFileName (string $type, [array $parts = array()])
  • string $type: The resource type to create the filename for
  • array $parts: An associative array of filename information
_setPath (line 713)

Sets an entire array of search paths for templates or resources.

  • since: 12.2
  • access: protected
void _setPath (string $type, mixed $path)
  • 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.

Inherited Methods

Inherited From JObject

 JObject::__construct()
 JObject::def()
 JObject::get()
 JObject::getError()
 JObject::getErrors()
 JObject::getProperties()
 JObject::set()
 JObject::setError()
 JObject::setProperties()
 JObject::__toString()

Documentation generated on Tue, 19 Nov 2013 15:06:51 +0100 by phpDocumentor 1.4.3