Joomla: Passing a variable to getInput ()

I create a backend component (1.6 / 1.7 / 2.5), where I need to transfer a variable from another view to the field of a new record. Variable gear works fine.

My problem is using getInput ().

To begin with, different values โ€‹โ€‹of the document pages and parameter formatting are confusing! For instance:

http://docs.joomla.org/API16:JForm/getInput :getInput($name, $group= '_default', $formControl= '_default', $groupControl= '_default', $value=null)

against

http://docs.joomla.org/JForm::getInput/1.6 :

public function getInput (
    $name 
    $group=null 
    $value=null
)

Problem:

I just need to pass the variable as the default, for example:

echo $this->form->getInput('id', $value=$this->userID );?>

The code above makes the input field disappear. If I choose $value=$this->userID, an input box will appear, although obviously it does not have a default value. I also tried:

$value=$this->userID;
echo $this->form->getInput('id', $value );

, . , , - getInput(), , , .

?

!

+3
1

, API:

getInput($name, $group = null, $value = null)

getInput() getField():

getField($name, $group = null, $value = null)

, , :

echo $this->form->getInput('id', null, $this->userID ); // Returns the $field->input String

:

$field = $this->form->getField('id', null, $this->userID ); // Returns the JFormField object
+6

All Articles