DataForm (with custom output)

There is not only {!! $form !!} to show your form.
If you need to customize something, wrap fields, grouping elements etc..
you can use partial rendering. See below





class DemoController extends Controller

....

    public function 
anyStyledform()
    {
        
$form = \DataForm::source(Article::find(1));

        
$form->add('title','Title''text')->rule('required|min:5');
        
$form->add('body','Body''redactor');
        
$form->add('categories.name','Categories','tags');
        
$form->add('photo','Photo''image')->move('uploads/demo/')->fit(240160)->preview(120,80);
        
$form->submit('Save');

        
$form->saved(function () use ($form) {
            
$form->message("ok record saved");
            
$form->link("/rapyd-demo/styledform","back to the form");
        });
        
$form->build();

        return 
view('rapyd::demo.styledform'compact('form'));
    }



@extends('rapyd::demo.demo')

@section('title','DataForm')

@section('body')

    @include('rapyd::demo.menu_form')

    <h1>DataForm (with custom output)</h1>

    <p>
        There is not only @{!! $form !!} to show your form.<br />
        If you need to customize something, wrap fields, grouping elements etc..<br />
        you can use partial rendering. See below



    </p>

        <div class="container">

        {!! $form->header !!}

            {!! $form->message !!}

            @if(!$form->message)


                <div class="row">

                    <div class="col-sm-4">
                        {!! $form->render('title') !!}

                        {!! $form->render('categories.name') !!}

                        {!! $form->render('photo') !!}

                    </div>

                    <div class="col-sm-8">

                         {!! $form->render('body') !!}
                    </div>
                    
                    
                </div>
            @endif

            <br />
        {!! $form->footer !!}

       </div>

        
        

@stop