mardi 12 janvier 2016

Laravel Blade - custom method for html block?

Is it possible to create own blade method/tag or what is the solution to this?

For example in a blade file, it will contain multiple form-block block like this:

<section class="container-fluid container-fixed-lg form-block">
    <div class="row b-b b-grey">
        <div class="col-xs-12 col-md-3 m-r-35">
            <h2>Title</h2>
            <p>Some content here</p>
        </div>
        <div class="col-xs-12 col-md-7">
            <div class="panel panel-default">
                <div class="panel-body">
                    // Custom Block Here
                </div>
            </div>
        </div>
    </div>
</section>

Is there a way to improve the readability/maintainability to have something like this in a blade file:

@form-block('Title','Some content here')
   // Custom Block Here
@end-form-block



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire