Actions

API17

Difference between revisions of "JView"

From Joomla! Documentation

(Layout updates)
m (moving preparation)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 +
=={{JVer|11.1}} JView==
 +
===Description===
 +
{{Description:JView}}
 
<span class="editsection" style="font-size:76%;">
 
<span class="editsection" style="font-size:76%;">
 
<nowiki>[</nowiki>[[Description:JView|Edit Descripton]]<nowiki>]</nowiki>
 
<nowiki>[</nowiki>[[Description:JView|Edit Descripton]]<nowiki>]</nowiki>
 
</span>
 
</span>
{{Description:JView}}
 
===Defined in===
 
libraries/joomla/application/component/view.php
 
* see source code in [[jplatform:application/component/view.php|BitBucket]]
 
===Subpackage===
 
[[Subpackage Application/11.1|Application]]
 
===Extends===
 
[[JObject/11.1|JObject]]
 
===Extended by===
 
 
===Methods===
 
===Methods===
 
{| class="wikitable sortable"
 
{| class="wikitable sortable"
 
|-
 
|-
 +
!Visibility
 
!Method name
 
!Method name
 
!Description
 
!Description
 
|-
 
|-
|[[JView::__construct/11.1|__construct]]
+
|public
|Constructor.
+
|[[API17:JView::addHelperPath|addHelperPath]]
|-
+
|[[JView::_addPath/11.1|_addPath]]
+
|Adds to the search path for templates and resources.
+
|-
+
|[[JView::_createFileName/11.1|_createFileName]]
+
|Create the filename for a resource.
+
|-
+
|[[JView::_setPath/11.1|_setPath]]
+
|Sets an entire array of search paths for templates or resources.
+
|-
+
|[[JView::addHelperPath/11.1|addHelperPath]]
+
 
|Adds to the stack of helper script paths in LIFO order.  
 
|Adds to the stack of helper script paths in LIFO order.  
 
|-
 
|-
|[[JView::addTemplatePath/11.1|addTemplatePath]]
+
|public
 +
|[[API17:JView::addTemplatePath|addTemplatePath]]
 
|Adds to the stack of view script paths in LIFO order.  
 
|Adds to the stack of view script paths in LIFO order.  
 
|-
 
|-
|[[JView::assign/11.1|assign]]
+
|public
 +
|[[API17:JView::assign|assign]]
 
|Assigns variables to the view script via differing strategies.  
 
|Assigns variables to the view script via differing strategies.  
 
|-
 
|-
|[[JView::assignRef/11.1|assignRef]]
+
|public
 +
|[[API17:JView::assignRef|assignRef]]
 
|Assign variable for the view (by reference).  
 
|Assign variable for the view (by reference).  
 
|-
 
|-
|[[JView::display/11.1|display]]
+
|public
 +
|[[API17:JView::display|display]]
 
|Execute and display a template script.  
 
|Execute and display a template script.  
 
|-
 
|-
|[[JView::escape/11.1|escape]]
+
|public
 +
|[[API17:JView::escape|escape]]
 
|Escapes a value for output in a view script.  
 
|Escapes a value for output in a view script.  
 
|-
 
|-
|[[JView::get/11.1|get]]
+
|public
 +
|[[API17:JView::get|get]]
 
|Method to get data from a registered model or a property of the view.  
 
|Method to get data from a registered model or a property of the view.  
 
|-
 
|-
|[[JView::getLayout/11.1|getLayout]]
+
|public
 +
|[[API17:JView::getLayout|getLayout]]
 
|Get the layout.  
 
|Get the layout.  
 
|-
 
|-
|[[JView::getLayoutTemplate/11.1|getLayoutTemplate]]
+
|public
 +
|[[API17:JView::getLayoutTemplate|getLayoutTemplate]]
 
|Get the layout template.  
 
|Get the layout template.  
 
|-
 
|-
|[[JView::getModel/11.1|getModel]]
+
|public
 +
|[[API17:JView::getModel|getModel]]
 
|Method to get the model object.  
 
|Method to get the model object.  
 
|-
 
|-
|[[JView::getName/11.1|getName]]
+
|public
 +
|[[API17:JView::getName|getName]]
 
|Method to get the view name.  
 
|Method to get the view name.  
 
|-
 
|-
|[[JView::loadHelper/11.1|loadHelper]]
+
|public
 +
|[[API17:JView::loadHelper|loadHelper]]
 
|Load a helper file.  
 
|Load a helper file.  
 
|-
 
|-
|[[JView::loadTemplate/11.1|loadTemplate]]
+
|public
 +
|[[API17:JView::loadTemplate|loadTemplate]]
 
|Load a template file -- first look in the templates folder for an override.  
 
|Load a template file -- first look in the templates folder for an override.  
 
|-
 
|-
|[[JView::setEscape/11.1|setEscape]]
+
|public
 +
|[[API17:JView::setEscape|setEscape]]
 
|Sets the _escape() callback.  
 
|Sets the _escape() callback.  
 
|-
 
|-
|[[JView::setLayout/11.1|setLayout]]
+
|public
 +
|[[API17:JView::setLayout|setLayout]]
 
|Sets the layout name to use.  
 
|Sets the layout name to use.  
 
|-
 
|-
|[[JView::setLayoutExt/11.1|setLayoutExt]]
+
|public
 +
|[[API17:JView::setLayoutExt|setLayoutExt]]
 
|Allows a different extension for the layout files to be used.  
 
|Allows a different extension for the layout files to be used.  
 
|-
 
|-
|[[JView::setModel/11.1|setModel]]
+
|public
 +
|[[API17:JView::setModel|setModel]]
 
|Method to add a model to the view.  
 
|Method to add a model to the view.  
 +
|-
 +
|protected
 +
|[[API17:JView::__construct|__construct]]
 +
|Constructor.
 +
|-
 +
|protected
 +
|[[API17:JView::_addPath|_addPath]]
 +
|Adds to the search path for templates and resources.
 +
|-
 +
|protected
 +
|[[API17:JView::_setPath|_setPath]]
 +
|Sets an entire array of search paths for templates or resources.
 
|-
 
|-
 
|}
 
|}
 +
* '''Defined in''' libraries/joomla/application/component/view.php
 +
* '''Extends''' [[API17:JObject|JObject]]
 
===Importing===
 
===Importing===
 
<source lang="php">jimport( 'joomla.application.component.view' );</source>
 
<source lang="php">jimport( 'joomla.application.component.view' );</source>
 
===See also===
 
===See also===
* JView source code in [[jplatform:application/component/view.php|BitBucket]]
+
* {{JVer|11.1}} '''JView source code''' on [[jplatform:application/component/view.php|BitBucket]]
* [[JView|Other versions of this class]]
+
* {{JVer|11.1}} Subpackage [[API17:Subpackage Application|Application]]
 +
* [[API17:JView|Other versions of JView]]
 
{{SeeAlso:JView}}
 
{{SeeAlso:JView}}
 
<span class="editsection" style="font-size:76%;">
 
<span class="editsection" style="font-size:76%;">
 
<nowiki>[</nowiki>[[SeeAlso:JView|Edit See Also]]<nowiki>]</nowiki>
 
<nowiki>[</nowiki>[[SeeAlso:JView|Edit See Also]]<nowiki>]</nowiki>
 
</span>
 
</span>
===Examples===
+
===User contributed notes===
 
<CodeExamplesForm />
 
<CodeExamplesForm />
 
<dpl>
 
<dpl>
Line 99: Line 114:
 
category=ClassExample
 
category=ClassExample
 
include=*
 
include=*
 +
namespace=CodeExample
 
format= ,,,
 
format= ,,,
 
</dpl>
 
</dpl>
<noinclude>[[Category:Platform]][[Category:Platform 11.1]][[Category:JView]]</noinclude>
+
<noinclude>[[Category:Platform 11.1]][[Category:Archived pages API17]]</noinclude>

Latest revision as of 21:50, 11 May 2013

Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Joomla 11.1 JView

Description

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. Learn more

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.

[Edit Descripton]

Methods

Visibility Method name Description
public addHelperPath Adds to the stack of helper script paths in LIFO order.
public addTemplatePath Adds to the stack of view script paths in LIFO order.
public assign Assigns variables to the view script via differing strategies.
public assignRef Assign variable for the view (by reference).
public display Execute and display a template script.
public escape Escapes a value for output in a view script.
public get Method to get data from a registered model or a property of the view.
public getLayout Get the layout.
public getLayoutTemplate Get the layout template.
public getModel Method to get the model object.
public getName Method to get the view name.
public loadHelper Load a helper file.
public loadTemplate Load a template file -- first look in the templates folder for an override.
public setEscape Sets the _escape() callback.
public setLayout Sets the layout name to use.
public setLayoutExt Allows a different extension for the layout files to be used.
public setModel Method to add a model to the view.
protected __construct Constructor.
protected _addPath Adds to the search path for templates and resources.
protected _setPath Sets an entire array of search paths for templates or resources.
  • Defined in libraries/joomla/application/component/view.php
  • Extends JObject

Importing

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

See also

SeeAlso:JView [Edit See Also]

User contributed notes

<CodeExamplesForm />