Craft\NeoFieldType::getInputHtml PHP Method

getInputHtml() public method

Builds the HTML for the input field.
public getInputHtml ( string $name, array $value ) : string
$name string
$value array
return string
    public function getInputHtml($name, $value)
    {
        if ($this->_getNamespaceDepth() > 1) {
            return '<span class="error">' . Craft::t("Unable to nest Neo fields.") . '</span>';
        }
        $id = craft()->templates->formatInputId($name);
        $settings = $this->getSettings();
        $field = $settings->getField();
        $translatable = $field ? (bool) $field->translatable : false;
        if ($value instanceof ElementCriteriaModel) {
            $value->limit = null;
            $value->status = null;
            $value->localeEnabled = null;
        } else {
            if (!$value) {
                $value = [];
            }
        }
        $html = craft()->templates->render('neo/_fieldtype/input', ['id' => $id, 'name' => $name, 'field' => $field, 'blockTypes' => $settings->getBlockTypes(), 'blocks' => $value, 'static' => false, 'translatable' => $translatable]);
        $this->_prepareInputHtml($id, $name, $settings, $value);
        return $html;
    }