JView/1.5
From Joomla! Documentation
< JView(Difference between revisions)
(Bulk upload by Doxiki2) |
(Layout updates) |
||
| Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
| + | =={{JVer|1.5}} 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> | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
===Methods=== | ===Methods=== | ||
{| class="wikitable sortable" | {| class="wikitable sortable" | ||
|- | |- | ||
| + | !Visibility | ||
!Method name | !Method name | ||
!Description | !Description | ||
|- | |- | ||
| + | |public | ||
|[[JView::__construct/1.5|__construct]] | |[[JView::__construct/1.5|__construct]] | ||
|Constructor. | |Constructor. | ||
|- | |- | ||
| + | |public | ||
|[[JView::_addPath/1.5|_addPath]] | |[[JView::_addPath/1.5|_addPath]] | ||
|Adds to the search path for templates and resources. | |Adds to the search path for templates and resources. | ||
|- | |- | ||
| + | |public | ||
|[[JView::_createFileName/1.5|_createFileName]] | |[[JView::_createFileName/1.5|_createFileName]] | ||
|Create the filename for a resource. | |Create the filename for a resource. | ||
|- | |- | ||
| + | |public | ||
|[[JView::_setPath/1.5|_setPath]] | |[[JView::_setPath/1.5|_setPath]] | ||
|Sets an entire array of search paths for templates or resources. | |Sets an entire array of search paths for templates or resources. | ||
|- | |- | ||
| + | |public | ||
|[[JView::addHelperPath/1.5|addHelperPath]] | |[[JView::addHelperPath/1.5|addHelperPath]] | ||
|Adds to the stack of helper script paths in LIFO order. | |Adds to the stack of helper script paths in LIFO order. | ||
|- | |- | ||
| + | |public | ||
|[[JView::addTemplatePath/1.5|addTemplatePath]] | |[[JView::addTemplatePath/1.5|addTemplatePath]] | ||
|Adds to the stack of view script paths in LIFO order. | |Adds to the stack of view script paths in LIFO order. | ||
|- | |- | ||
| + | |public | ||
|[[JView::assign/1.5|assign]] | |[[JView::assign/1.5|assign]] | ||
|Assigns variables to the view script via differing strategies. | |Assigns variables to the view script via differing strategies. | ||
|- | |- | ||
| + | |public | ||
|[[JView::assignRef/1.5|assignRef]] | |[[JView::assignRef/1.5|assignRef]] | ||
|Assign variable for the view (by reference). | |Assign variable for the view (by reference). | ||
|- | |- | ||
| + | |public | ||
|[[JView::display/1.5|display]] | |[[JView::display/1.5|display]] | ||
|Execute and display a template script. | |Execute and display a template script. | ||
|- | |- | ||
| + | |public | ||
|[[JView::escape/1.5|escape]] | |[[JView::escape/1.5|escape]] | ||
|Escapes a value for output in a view script. | |Escapes a value for output in a view script. | ||
|- | |- | ||
| + | |public | ||
|[[JView::get/1.5|get]] | |[[JView::get/1.5|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. | ||
|- | |- | ||
| + | |public | ||
|[[JView::getLayout/1.5|getLayout]] | |[[JView::getLayout/1.5|getLayout]] | ||
|Get the layout. | |Get the layout. | ||
|- | |- | ||
| + | |public | ||
|[[JView::getModel/1.5|getModel]] | |[[JView::getModel/1.5|getModel]] | ||
|Method to get the model object. | |Method to get the model object. | ||
|- | |- | ||
| + | |public | ||
|[[JView::getName/1.5|getName]] | |[[JView::getName/1.5|getName]] | ||
|Method to get the view name. | |Method to get the view name. | ||
|- | |- | ||
| + | |public | ||
|[[JView::loadHelper/1.5|loadHelper]] | |[[JView::loadHelper/1.5|loadHelper]] | ||
|Load a helper file. | |Load a helper file. | ||
|- | |- | ||
| + | |public | ||
|[[JView::loadTemplate/1.5|loadTemplate]] | |[[JView::loadTemplate/1.5|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. | ||
|- | |- | ||
| + | |public | ||
|[[JView::setEscape/1.5|setEscape]] | |[[JView::setEscape/1.5|setEscape]] | ||
|Sets the _escape() callback. | |Sets the _escape() callback. | ||
|- | |- | ||
| + | |public | ||
|[[JView::setLayout/1.5|setLayout]] | |[[JView::setLayout/1.5|setLayout]] | ||
|Sets the layout name to use. | |Sets the layout name to use. | ||
|- | |- | ||
| + | |public | ||
|[[JView::setLayoutExt/1.5|setLayoutExt]] | |[[JView::setLayoutExt/1.5|setLayoutExt]] | ||
|Allows a different extension for the layout files to be used. | |Allows a different extension for the layout files to be used. | ||
|- | |- | ||
| + | |public | ||
|[[JView::setModel/1.5|setModel]] | |[[JView::setModel/1.5|setModel]] | ||
|Method to add a model to the view. | |Method to add a model to the view. | ||
|- | |- | ||
|} | |} | ||
| + | * '''Defined in''' libraries/joomla/application/component/view.php | ||
| + | * '''Extends''' [[JObject/1.5|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=== | ||
| + | * {{JVer|1.5}} '''JView''' on [http://api.joomla.org/Joomla-Framework/Application/JView.html api.joomla.org] | ||
| + | * {{JVer|1.5}} '''JView source code''' on [[jframework15:application/component/view.php|JoomlaCode]] | ||
| + | * {{JVer|1.5}} Subpackage [[Subpackage Application/1.5|Application]] | ||
| + | * [[JView|Other versions of 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> | ||
| − | + | ===User contributed notes=== | |
| − | + | ||
| − | + | ||
| − | === | + | |
<CodeExamplesForm /> | <CodeExamplesForm /> | ||
<dpl> | <dpl> | ||
| Line 95: | Line 115: | ||
category=ClassExample | category=ClassExample | ||
include=* | include=* | ||
| + | namespace=CodeExample | ||
format= ,,, | format= ,,, | ||
</dpl> | </dpl> | ||
<noinclude>[[Category:Framework]][[Category:Framework 1.5]][[Category:JView]]</noinclude> | <noinclude>[[Category:Framework]][[Category:Framework 1.5]][[Category:JView]]</noinclude> | ||
Revision as of 18:14, 25 April 2011
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.
Methods
| Visibility | Method name | Description |
|---|---|---|
| public | __construct | Constructor. |
| public | _addPath | Adds to the search path for templates and resources. |
| public | _createFileName | Create the filename for a resource. |
| public | _setPath | Sets an entire array of search paths for templates or resources. |
| 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 | 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. |
- Defined in libraries/joomla/application/component/view.php
- Extends JObject
Importing
jimport( 'joomla.application.component.view' );
See also
-
JView on api.joomla.org
-
JView source code on JoomlaCode
-
Subpackage Application
- Other versions of JView
User contributed notes
<CodeExamplesForm />