JView

From Joomla! Documentation

Jump to: navigation, search

JView is an abstract class which provides the basic functionality for Joomla's MVC design pattern. You need to write your own concrete View classes, to make full use of the functionality.

Contents

Availability

From Joomla 1.5 Joomla 1.6

Defined in

libraries/joomla/application/component/view.php

Extends

Get and Set Methods

Properties which do not have specific get or set methods listed here can be retrieved or set using the inherited JObject->get method.

Get method Set method Description Property
getLayout setLayout Get/Set the Layout of the view $view->_layout

Other Methods

Method name Description
__construct Constructor
addHelperPath Adds path to the stack of helper script paths in LIFO order
addTemplatePath Adds path to the stack of helper script paths in LIFO order.
assign Assigns varibles to the view. See also the get method.
assignRef Assign variable to the view by reference
display Execute and display a template script
escape Escapes a value for output in a view script.
get Method to get data from a registered model or a property of the view
getModel Method to get a registered model object
getName Method to get the view name
loadHelper Load a helper file
loadTemplate Load a template file. Looks first in the templates folder for an override
setEscape Sets the _escape() callback.
setLayoutExt Allows a different extension for the layout files to be used
setModel Add a model to the model stack of this view. Optionally, make this model the default model.

Importing

jimport( 'joomla.application.component.view' );

The Joomla MVC Design Pattern

Model-View-Controller (MVC) is a set of design patterns, that are used to separate the different layers of your application.

  • The View displays the data of the model by passing it to a template. The view object can therefore access the data of the model. Joomla implements the basic functionality in the abstract JView class.
  • The Model stores the data of the application, and contains the business logic. Joomla implements the basic functionality in the abstract JModel class.
  • The Controller handles the user requests and evokes the model and the views to change it's state. Joomla implements the basic functionality in the JController class.

Learn more

See also

Personal tools