Skip to content
This repository has been archived by the owner on Nov 29, 2022. It is now read-only.

Blade syntax isn't working #29

Closed
aaronflorey opened this issue Jul 3, 2014 · 1 comment
Closed

Blade syntax isn't working #29

aaronflorey opened this issue Jul 3, 2014 · 1 comment

Comments

@aaronflorey
Copy link

Not sure why, but my blade syntax isn't being parsed :s

Controller:

            $grid = \DataGrid::source(\Post::select('*')); //same source types of DataSet

            $grid->add('title', 'Title', true); //field name, label, sortable
            $grid->add('{{ $post->created_at }}', 'Posted'); //blade syntax with main field
            $grid->edit('/admin/blog/edit/', 'Edit', 'modify|delete'); //shortcut to link DataEdit actions
            $grid->orderBy('created_at', 'desc'); //default orderby
            $grid->paginate(10); //pagination

            return \View::make('admin::blog.index', compact('grid'));

View:

@section('content')
<div class="col-md-12">
    <div class="box box-primary">
        <div class="box-header">
            <h3 class="box-title">Edit Blog</h3>
        </div><!-- /.box-header -->
        <!-- form start -->
           {{ $form }}
    </div>
</div>
@endsection
@zofe
Copy link
Owner

zofe commented Jul 3, 2014

I'ts because created_at is on the main model and not on a related one.
So it's accessible via {{ $created_at }}.

@zofe zofe closed this as completed Jul 5, 2014
zhwei added a commit to zhwei/rapyd-laravel that referenced this issue Mar 27, 2016
fix 修label太长时的布局问题
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants