classes/Controllers/Elements.php
public static function renderField($el, $key = null)
    {
        if (!$key) {
            $key = $el->inputName();
        }

        $id = str_replace('|', '-', $key);

        switch ($el->type) {
            case 'text':
                return Former::text($key, $el->label)
                    ->blockHelp($el->help)
                    ->id($id);

            case 'textarea':
                return Former::textarea($key, $el->label)
                    ->blockHelp($el->help)
                    ->id($id);

            case 'wysiwyg':
                return Former::wysiwyg($key, $el->label)
                    ->blockHelp($el->help)
                    ->id($id);

            case 'image':
                return Former::image($key, $el->label)
                    ->forElement($el)
                    ->id($id);

            case 'file':
                return Former::upload($key, $el->label)
                    ->blockHelp($el->help)
                    ->id($id);

            case 'boolean':
                return Former::checkbox($key, false)
                    ->checkboxes([
                        "<b>{$el->label}</b>" => [
                            'name' => $key,
                            'value' => 1,
                        ],
                    ])
                    ->blockHelp($el->help)
                    ->id($id)
                    ->push();

            case 'select':
                return Former::select($key, $el->label)
                    ->options($el->options)
                    ->blockHelp($el->help)
                    ->id($id);

            case 'radios':
                return Former::radiolist($key, $el->label)
                    ->from($el->options)
                    ->blockHelp($el->help)
                    ->id($id);

            case 'checkboxes':
                return Former::checklist($key, $el->label)
                    ->from($el->options)
                    ->blockHelp($el->help)
                    ->id($id);

            case 'video-encoder':
                return Former::videoEncoder($key, $el->label)
                    ->blockHelp($el->help)
                    ->model($el)
                    ->preset($el->preset)
                    ->id($id);

            case 'model':
                return Former::belongsTo($key, $el->label)
                    ->parent($el->class)
                    ->blockHelp($el->help)
                    ->id($id);
        }
    }
public static function renderField($el, $key = null)
    {
        if (!$key) {
            $key = $el->inputName();
        }

        $id = str_replace('|', '-', $key);

        switch ($el->type) {
            case 'text':
                return Former::text($key, $el->label)
                    ->blockHelp($el->help)
                    ->id($id);

            case 'textarea':
                return Former::textarea($key, $el->label)
                    ->blockHelp($el->help)
                    ->id($id);

            case 'wysiwyg':
                return Former::wysiwyg($key, $el->label)
                    ->blockHelp($el->help)
                    ->id($id);

            case 'image':
                return Former::image($key, $el->label)
                    ->forElement($el)
                    ->id($id);

            case 'file':
                return Former::upload($key, $el->label)
                    ->blockHelp($el->help)
                    ->id($id);

            case 'boolean':
                return Former::checkbox($key, false)
                    ->checkboxes([
                        "<b>{$el->label}</b>" => [
                            'name' => $key,
                            'value' => 1,
                        ],
                    ])
                    ->blockHelp($el->help)
                    ->id($id)
                    ->push();

            case 'select':
                return Former::select($key, $el->label)
                    ->options($el->options)
                    ->blockHelp($el->help)
                    ->id($id);

            case 'radios':
                return Former::radiolist($key, $el->label)
                    ->from($el->options)
                    ->blockHelp($el->help)
                    ->id($id);

            case 'checkboxes':
                return Former::checklist($key, $el->label)
                    ->from($el->options)
                    ->blockHelp($el->help)
                    ->id($id);

            case 'video-encoder':
                return Former::videoEncoder($key, $el->label)
                    ->blockHelp($el->help)
                    ->model($el)
                    ->preset($el->preset)
                    ->id($id);

            case 'model':
                return Former::belongsTo($key, $el->label)
                    ->parent($el->class)
                    ->blockHelp($el->help)
                    ->id($id);
        }
    }
public static function renderField ( $ el , $ key = null ) { if ( ! $ key ) { $ key = $ el -> inputName ( ) ; } $ id = str_replace ( '|' , '-' , $ key ) ; switch ( $ el -> type ) { case 'text' : return Former :: text ( $ key , $ el -> label ) -> blockHelp ( $ el -> help ) -> id ( $ id ) ; case 'textarea' : return Former :: textarea ( $ key , $ el -> label ) -> blockHelp ( $ el -> help ) -> id ( $ id ) ; case 'wysiwyg' : return Former :: wysiwyg ( $ key , $ el -> label ) -> blockHelp ( $ el -> help ) -> id ( $ id ) ; case 'image' : return Former :: image ( $ key , $ el -> label ) -> forElement ( $ el ) -> id ( $ id ) ; case 'file' : return Former :: upload ( $ key , $ el -> label ) -> blockHelp ( $ el -> help ) -> id ( $ id ) ; case 'boolean' : return Former :: checkbox ( $ key , false ) -> checkboxes ( [ "<b>{$el->label}</b>" => [ 'name' => $ key , 'value' => 1 , ] , ] ) -> blockHelp ( $ el -> help ) -> id ( $ id ) -> push ( ) ; case 'select' : return Former :: select ( $ key , $ el -> label ) -> options ( $ el -> options ) -> blockHelp ( $ el -> help ) -> id ( $ id ) ; case 'radios' : return Former :: radiolist ( $ key , $ el -> label ) -> from ( $ el -> options ) -> blockHelp ( $ el -> help ) -> id ( $ id ) ; case 'checkboxes' : return Former :: checklist ( $ key , $ el -> label ) -> from ( $ el -> options ) -> blockHelp ( $ el -> help ) -> id ( $ id ) ; case 'video-encoder' : return Former :: videoEncoder ( $ key , $ el -> label ) -> blockHelp ( $ el -> help ) -> model ( $ el ) -> preset ( $ el -> preset ) -> id ( $ id ) ; case 'model' : return Former :: belongsTo ( $ key , $ el -> label ) -> parent ( $ el -> class ) -> blockHelp ( $ el -> help ) -> id ( $ id ) ; } }
A helper function for rendering the list of fields

@param  Bkwld\Decoy\Models\Element $el
@param  string                     $key
@return Former\Traits\Object
A helper function for rendering the list of fields