Back to Joomla project (class list)

Class AbstractView - list of methods

Base class for a Joomla View
Class holding methods for displaying presentation data.

Extends

Extends

Direct known subclasses

Package: Joomla\CMS\MVC\View
Copyright: (C) 2005 Open Source Matters, Inc.
License: GNU General Public License version 2 or later; see LICENSE.txt
Located at: Joomla/MVC/View/AbstractView.php
Project: Joomla

Method Summary

public
(mixed $config = array())

Constructor
Parameters
  • 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
Since
  • 3.0
Show source code of this method: __construct Source Code

public void
(mixed $tpl = null)

Execute and display a template script.
Parameters
  • string $tpl The name of the template file to parse; automatically searches through the template paths.
Returns
  • void
Since
  • 3.0
Show source code of this method: display Source Code

public mixed
(mixed $property, mixed $default = null)

Method to get data from a registered model or a property of the view
Parameters
  • 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]
Returns
  • mixed The return value of the method
Since
  • 3.0
Show source code of this method: get Source Code

public \Joomla\CMS\MVC\Model\BaseDatabaseModel
(mixed $name = null)

Method to get the model object
Parameters
  • string $name The name of the model (optional)
Returns
  • \Joomla\CMS\MVC\Model\BaseDatabaseModel The model object
Since
  • 3.0
Show source code of this method: getModel Source Code

public \Joomla\CMS\MVC\Model\BaseDatabaseModel
(mixed $model, mixed $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.
Parameters
  • \Joomla\CMS\MVC\Model\BaseDatabaseModel $model The model to add to the view.
  • bool $default Is this the default model?
Returns
  • \Joomla\CMS\MVC\Model\BaseDatabaseModel The added model.
Since
  • 3.0
Show source code of this method: setModel Source Code

public string
()

Method to get the view name
Returns
  • string The name of the model
Since
  • 3.0
-
  • \Exception
Show source code of this method: getName Source Code

protected void
(\Joomla\Event\EventInterface $event)

Dispatches the given event on the internal dispatcher, does a fallback to the global one.
Parameters
  • \Joomla\Event\EventInterface $event The event
Returns
  • void
Since
  • 4.1.0
Show source code of this method: dispatchEvent Source Code

Properties Summary

public \Joomla\CMS\Document\Document
$document
The active document object
Since
  • 3.0
protected string
$option
The URL option for the component. It is usually passed by controller while it creates the view
Since
  • 3.0
protected array
$_name
The name of the view
Since
  • 3.0
protected array
$_models
Registered models
Since
  • 3.0
protected string
$_defaultModel
The default model
Since
  • 3.0

Tags Summary

Since
2.5.5