JView

From Joomla! Documentation
(Difference between revisions)
Jump to: navigation, search
(New page: '''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 functiona...)
 
m (bad link repair)
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
'''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.
+
This class is available in the following Joomla versions:-
 
+
<splist showpath=notparent />
===Availability===
+
<noinclude>[[Category:Platform JClasses]][[Category:JView]]</noinclude>
{{JVer|1.5|From Joomla 1.5}} {{JVer|1.6|Joomla 1.6}}
+
 
+
===Defined in===
+
libraries/joomla/application/component/view.php
+
 
+
===Extends===
+
* [[JObject]]
+
 
+
===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|JObject->get]] method.
+
{| class="wikitable"
+
|-
+
!Get method
+
!Set method
+
!Description
+
!Property
+
|-
+
|[[JView/getLayout|getLayout]]
+
|[[JView/setLayout|setLayout]]
+
|Get/Set the Layout of the view
+
|<code>$view->_layout</code>
+
|}
+
 
+
===Other Methods===
+
{| class="wikitable"
+
|-
+
!Method name
+
!Description
+
|-
+
|[[JView/__construct|__construct]]
+
|Constructor
+
|-
+
|[[JView/addHelperPath|addHelperPath]]
+
|Adds path to the stack of helper script paths in LIFO order
+
|-
+
|[[JView/addTemplagePath|addTemplatePath]]
+
|Adds path to the stack of helper script paths in LIFO order.
+
|-
+
|[[JView/assign|assign]]
+
|Assigns varibles to the view. See also the [[JView/get|get]] method.
+
|-
+
|[[JView/assignRef|assignRef]]
+
|Assign variable to the view by reference
+
|-
+
|[[JView/display|display]]
+
|Execute and display a template script
+
|-
+
|[[JView/escape|escape]]
+
|Escapes a value for output in a view script.
+
|-
+
|[[JView/get|get]]
+
|Method to get data from a registered model or a property of the view
+
|-
+
|[[JView/getModel|getModel]]
+
|Method to get a registered model object
+
|-
+
|[[JView/getName|getName]]
+
|Method to get the view name
+
|-
+
|[[JView/loadHelper|loadHelper]]
+
|Load a helper file
+
|-
+
|[[JView/loadTemplate|loadTemplate]]
+
|Load a template file. Looks first in the templates folder for an override
+
|-
+
|[[JView/setEscape|setEscape]]
+
|Sets the _escape() callback.
+
|-
+
|[[JView/setLayoutExt|setLayoutExt]]
+
|Allows a different extension for the layout files to be used
+
|[[JView/setModel|setModel]]
+
|}
+
===Importing===
+
<source lang="php">jimport( 'joomla.application.component.view' );</source>
+
 
+
===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.
+
 
+
[[Developing_a_Model-View-Controller_Component_-_Part_1 Learn more]]
+
 
+
===See also===
+
* [http://api.joomla.org/Joomla-Framework/Application/JView.html JView on api.joomla.org]
+
<noinclude>[[Category:Development]][[Category:Framework]][[Category:JDocument]]</noinclude>
+

Latest revision as of 14:07, 29 August 2012

This class is available in the following Joomla versions:-

Personal tools
Namespaces

Variants
Actions
Navigation
Joomla! Sites
Toolbox