public function adaptee(Grid &$grid, array $controls = array(), Fluent $model)
    {
        if (empty($controls)) {
            return false;
        }
        $grid->fieldset(function (Fieldset $fieldset) use($controls, $model) {
            $editable    = $model->get('editable', []);
            $displayable = $model->get('displayable', []);

            foreach ($controls as $control) {
                $name = $control['name'];

                $fieldset->control($control['type'], $name)
                        ->label($control['label'])
                        ->value($control['value'])
                        ->attributes(['disabled' => 'disabled', 'readonly' => 'readonly']);

                $fieldset->control('input:checkbox', 'editable[' . $name . ']')
                        ->value($control['value'])
                        ->label(trans('editable'))
                        ->attributes($this->checked($control, $editable));

                $fieldset->control('input:checkbox', 'displayable[' . $name . ']')
                        ->value($control['value'])
                        ->label(trans('displayable'))
                        ->attributes($this->checked($control, $displayable));
            }
        });
    }
public function adaptee(Grid &$grid, array $controls = array(), Fluent $model)
    {
        if (empty($controls)) {
            return false;
        }
        $grid->fieldset(function (Fieldset $fieldset) use($controls, $model) {
            $editable    = $model->get('editable', []);
            $displayable = $model->get('displayable', []);

            foreach ($controls as $control) {
                $name = $control['name'];

                $fieldset->control($control['type'], $name)
                        ->label($control['label'])
                        ->value($control['value'])
                        ->attributes(['disabled' => 'disabled', 'readonly' => 'readonly']);

                $fieldset->control('input:checkbox', 'editable[' . $name . ']')
                        ->value($control['value'])
                        ->label(trans('editable'))
                        ->attributes($this->checked($control, $editable));

                $fieldset->control('input:checkbox', 'displayable[' . $name . ']')
                        ->value($control['value'])
                        ->label(trans('displayable'))
                        ->attributes($this->checked($control, $displayable));
            }
        });
    }
public function adaptee ( Grid & $ grid , array $ controls = array ( ) , Fluent $ model ) { if ( empty ( $ controls ) ) { return false ; } $ grid -> fieldset ( function ( Fieldset $ fieldset ) use ( $ controls , $ model ) { $ editable = $ model -> get ( 'editable' , [ ] ) ; $ displayable = $ model -> get ( 'displayable' , [ ] ) ; foreach ( $ controls as $ control ) { $ name = $ control [ 'name' ] ; $ fieldset -> control ( $ control [ 'type' ] , $ name ) -> label ( $ control [ 'label' ] ) -> value ( $ control [ 'value' ] ) -> attributes ( [ 'disabled' => 'disabled' , 'readonly' => 'readonly' ] ) ; $ fieldset -> control ( 'input:checkbox' , 'editable[' . $ name . ']' ) -> value ( $ control [ 'value' ] ) -> label ( trans ( 'editable' ) ) -> attributes ( $ this -> checked ( $ control , $ editable ) ) ; $ fieldset -> control ( 'input:checkbox' , 'displayable[' . $ name . ']' ) -> value ( $ control [ 'value' ] ) -> label ( trans ( 'displayable' ) ) -> attributes ( $ this -> checked ( $ control , $ displayable ) ) ; } } ) ; }
adaptee controls on form instance

@param FormFactory $form
@param array $controls
@param Fluent $model
@return boolean
adaptee controls on form instance