Support Joomla!

references:joomla.framework:application:jview-get

Table of Contents

get

API Package Subpackage Class Method Reference Last reviewed Doc status
API Home Package Joomla.Framework Subpackage Application Class JView Method get Reference get() Never Work in Progress

Retrieves data from a registered model.

This method can be used from the view to invoke data retrieval methods on the model. The method will invoke the specified ‘get’ method on the specified model. A call to get( ‘example’ ) will invoke the method getExample on the model. If no model is specified, the default model will be used. If the method does not exist on the specified model, then a warning will be raised.

If the specified model does not exist then the JObject::get() method will be invoked with the specified parameters.

The method returns the result of the model method call or false if the method failed.

Syntax

mixed &get ( $method, $model )

$method string is a string containing the name of the method to call on the model.
$model string is a string containing the name of the model to reference. This parameter is optional and if omitted the default model will be used.

Examples

If you had a model object with the following method:

JModel::getExample() method

function getExample() {
	return 'example';
}

you might call it in your view using:

Example

$example = $this->get('example');

DISCUSSION~~

 
references/joomla.framework/application/jview-get.txt (9180 views) · Last modified: 2007/08/15 14:48