tl_form_field::listFormFields PHP Метод

listFormFields() публичный Метод

Add the type of input field
public listFormFields ( array $arrRow ) : string
$arrRow array
Результат string
    public function listFormFields($arrRow)
    {
        $arrRow['required'] = $arrRow['mandatory'];
        $key = $arrRow['invisible'] ? 'unpublished' : 'published';
        $strType = '
<div class="cte_type ' . $key . '">' . $GLOBALS['TL_LANG']['FFL'][$arrRow['type']][0] . ($arrRow['name'] ? ' (' . $arrRow['name'] . ')' : '') . '</div>
<div class="limit_height' . (!Config::get('doNotCollapse') ? ' h32' : '') . '">';
        $strClass = $GLOBALS['TL_FFL'][$arrRow['type']];
        if (!class_exists($strClass)) {
            return '';
        }
        /** @var Widget $objWidget */
        $objWidget = new $strClass($arrRow);
        $strWidget = $objWidget->parse();
        $strWidget = preg_replace('/ name="[^"]+"/i', '', $strWidget);
        $strWidget = str_replace(array(' type="submit"', ' autofocus', ' required'), array(' type="button"', '', ''), $strWidget);
        if ($objWidget instanceof FormHidden) {
            return $strType . "\n" . $objWidget->value . "\n</div>\n";
        }
        return $strType . StringUtil::insertTagToSrc($strWidget) . '
</div>' . "\n";
    }

Usage Example

 public function listFormFields($arrRow)
 {
     $return = parent::listFormFields($arrRow);
     $return = GridClass::addClassesToLabels($arrRow, $return);
     return $return;
 }