Created
March 22, 2016 14:51
-
-
Save joomdonation/15f94c19aff36816b830 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function getUserInput($userId) | |
| { | |
| $form = JForm::getInstance('user-field', '<form> </form>'); | |
| $element = new SimpleXMLElement('<field />'); | |
| $element->addAttribute('type', 'User'); | |
| $element->addAttribute('name', 'user_id'); | |
| $element->addAttribute('class', 'readonly'); | |
| $form->setField($element); | |
| $form->setValue('user_id', null, $userId); | |
| $field = $form->getField('user_id'); | |
| echo $field->input; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment