Back to Joomla project (class list)

Class HtmlView - list of methods

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

Extends

Direct known subclasses

Package: Joomla\CMS\MVC\View
Copyright: (C) 2006 Open Source Matters, Inc.
License: GNU General Public License version 2 or later; see LICENSE.txt
Located at: Joomla/MVC/View/HtmlView.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
-
  • \Exception
  • \JViewLegacy::loadTemplate()
Show source code of this method: display Source Code

public mixed
(mixed $var)

Escapes a value for output in a view script.
Parameters
  • mixed $var The output to escape.
Returns
  • mixed The escaped value.
Since
  • 3.0
-
  • the ENT_COMPAT flag was replaced by ENT_QUOTES in Joomla 4.0 to also escape single quotes
Show source code of this method: escape Source Code

public string
()

Get the layout.
Returns
  • string The layout name
Since
  • 3.0
Show source code of this method: getLayout Source Code

public string
()

Get the layout template.
Returns
  • string The layout template name
Since
  • 3.0
Show source code of this method: getLayoutTemplate Source Code

public string
(mixed $layout)

Sets the layout name to use
Parameters
  • string $layout The layout name or a string in format <template>:<layout file>
Returns
  • string Previous value.
Since
  • 3.0
Show source code of this method: setLayout Source Code

public string
(mixed $value)

Allows a different extension for the layout files to be used
Parameters
  • string $value The extension.
Returns
  • string Previous value
Since
  • 3.0
Show source code of this method: setLayoutExt Source Code

public void
(mixed $path)

Adds to the stack of view script paths in LIFO order.
Parameters
  • mixed $path A directory path or an array of paths.
Returns
  • void
Since
  • 3.0
Show source code of this method: addTemplatePath Source Code

public void
(mixed $path)

Adds to the stack of helper script paths in LIFO order.
Parameters
  • mixed $path A directory path or an array of paths.
Returns
  • void
Since
  • 3.0
Show source code of this method: addHelperPath Source Code

public string
(mixed $tpl = null)

Load a template file -- first look in the templates folder for an override
Parameters
  • string $tpl The name of the template source file; automatically searches the template paths and compiles as needed.
Returns
  • string The output of the the template script.
Since
  • 3.0
-
  • \Exception
Show source code of this method: loadTemplate Source Code

public void
(mixed $hlp = null)

Load a helper file
Parameters
  • string $hlp The name of the helper source file automatically searches the helper paths and compiles as needed.
Returns
  • void
Since
  • 3.0
Show source code of this method: loadHelper Source Code

protected void
(mixed $type, mixed $path)

Sets an entire array of search paths for templates or resources.
Parameters
  • 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.
Returns
  • void
Since
  • 3.0
Show source code of this method: _setPath Source Code

protected void
(mixed $type, mixed $path)

Adds to the search path for templates and resources.
Parameters
  • string $type The type of path to add.
  • mixed $path The directory or stream, or an array of either, to search.
Returns
  • void
Since
  • 3.0
Show source code of this method: _addPath Source Code

protected string
(mixed $type, mixed $parts = array())

Create the filename for a resource
Parameters
  • string $type The resource type to create the filename for
  • array $parts An associative array of filename information
Returns
  • string The filename
Since
  • 3.0
Show source code of this method: _createFileName Source Code

public mixed
()

Returns the form object
Returns
  • mixed A \JForm object on success, false on failure
Since
  • 3.2
Show source code of this method: getForm Source Code

public void
(mixed $title)

Sets the document title according to Global Configuration options
Parameters
  • string $title The page title
Returns
  • void
Since
  • 3.6
Show source code of this method: setDocumentTitle Source Code

Properties Summary

protected string
$_basePath
The base path of the view
Since
  • 3.0
protected string
$_layout
Layout name
Since
  • 3.0
protected string
$_layoutExt
Layout extension
Since
  • 3.0
protected string
$_layoutTemplate
Layout template
Since
  • 3.0
protected array
$_path
The set of search directories for resources (templates)
Since
  • 3.0
protected string
$_template
The name of the default template source file.
Since
  • 3.0
protected string
$_output
The output of the template script.
Since
  • 3.0
protected string
$_charset
Charset to use in escaping mechanisms; defaults to urf8 (UTF-8)
Since
  • 3.0

Tags Summary

Since
2.5.5