public function renderField($field, $options = [])
    {
        $this->prepareVars();

        if (is_string($field)) {
            if (!isset($this->allFields[$field])) {
                throw new ApplicationException(Lang::get(
                    'backend::lang.form.missing_definition',
                    compact('field')
                ));
            }

            $field = $this->allFields[$field];
        }

        if (!isset($options['useContainer'])) {
            $options['useContainer'] = true;
        }
        $targetPartial = $options['useContainer'] ? 'field-container' : 'field';

        return $this->makePartial($targetPartial, ['field' => $field]);
    }
public function renderField($field, $options = [])
    {
        $this->prepareVars();

        if (is_string($field)) {
            if (!isset($this->allFields[$field])) {
                throw new ApplicationException(Lang::get(
                    'backend::lang.form.missing_definition',
                    compact('field')
                ));
            }

            $field = $this->allFields[$field];
        }

        if (!isset($options['useContainer'])) {
            $options['useContainer'] = true;
        }
        $targetPartial = $options['useContainer'] ? 'field-container' : 'field';

        return $this->makePartial($targetPartial, ['field' => $field]);
    }
public function renderField ( $ field , $ options = [ ] ) { $ this -> prepareVars ( ) ; if ( is_string ( $ field ) ) { if ( ! isset ( $ this -> allFields [ $ field ] ) ) { throw new ApplicationException ( Lang :: get ( 'backend::lang.form.missing_definition' , compact ( 'field' ) ) ) ; } $ field = $ this -> allFields [ $ field ] ; } if ( ! isset ( $ options [ 'useContainer' ] ) ) { $ options [ 'useContainer' ] = true ; } $ targetPartial = $ options [ 'useContainer' ] ? 'field-container' : 'field' ; return $ this -> makePartial ( $ targetPartial , [ 'field' => $ field ] ) ; }
Renders a single form field

Options:
- useContainer: Wrap the result in a container, used by AJAX. Default: true

@param string|array $field The field name or definition
@param array $options
@return string|bool The rendered partial contents, or false if suppressing an exception
Renders a single form field