API16

JControllerForm/getModel: Difference between revisions

From Joomla! Documentation

m clean up
m preparing for archive only
 
Line 52: Line 52:


===Examples===
===Examples===
<CodeExamplesForm />
=== Code Examples ===
<dpl>
<dpl>
  noresultsheader=\n
  noresultsheader=\n
  category=getModel
  category=getModel
  category=JControllerForm
  category=JControllerForm
  category=CodeExample
  namespace=CodeExample
  category=MethodExample
  category=MethodExample
  include=*
  include=*

Latest revision as of 01:25, 25 March 2017

Description

Method to get a model object, loading it if required.


<! removed transcluded page call, red link never existed >

Syntax

getModel($name= '', $prefix= '', $config=array('ignore_request'=> true))
Parameter Name Default Value Description
$name The model name. Optional.
$prefix The class prefix. Optional.
$config array('ignore_request'=> true) Configuration array for model. Optional.

Returns

object The model.

Defined in

libraries/joomla/application/component/controllerform.php

Importing

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

Source Body

public function getModel($name = '', $prefix = '', $config = array('ignore_request' => true))
{
        if (empty($name)) {
                $name = $this->_context;
        }

        return parent::getModel($name, $prefix, $config);
}


<! removed transcluded page call, red link never existed >

Examples

Code Examples