Back to TagField class

Method getInput

protected string
getInput
()
Method to get the field input for a tag field.
Returns
  • string The field input.
Since
  • 3.1
Class: TagField
Project: Joomla

Method getInput - Source code

/**
 * Method to get the field input for a tag field.
 *
 * @return  string  The field input.
 *
 * @since   3.1
 */
protected function getInput()
{
    $data = $this->getLayoutData();
    if (!\is_array($this->value) && !empty($this->value)) {
        if ($this->value instanceof TagsHelper) {
            if (empty($this->value->tags)) {
                $this->value = array();
            } else {
                $this->value = $this->value->tags;
            }
        }
        // String in format 2,5,4
        if (\is_string($this->value)) {
            $this->value = explode(',', $this->value);
        }
        // Integer is given
        if (\is_int($this->value)) {
            $this->value = array($this->value);
        }
        $data['value'] = $this->value;
    }
    $data['remoteSearch'] = $this->isRemoteSearch();
    $data['options'] = $this->getOptions();
    $data['isNested'] = $this->isNested();
    $data['allowCustom'] = $this->allowCustom();
    $data['minTermLength'] = (int) $this->comParams->get('min_term_length', 3);
    return $this->getRenderer($this->layout)->render($data);
}