PHP code example of pustato / laravel-blade-render-flow

1. Go to this page and download the library: Download pustato/laravel-blade-render-flow library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

pustato / laravel-blade-render-flow example snippets


Pustato\LaravelBladeRenderFlow\ServiceProvider::class,

@php
    $src = 'http://placehold.it/100x100';
    $title = 'Placeholder image';
@endphp
@capture(placeholder)
<img src="{{ $src }}" title="{{ $title }}" alt="{{ $titel }}"/>
@endcapture

<div>
    @flush('placeholder')
</div>
<div>
    @flush('placeholder')
</div>
<div>
    @flush('placeholder')
</div>
@clearcapture('placeholder')

@template('img')
<img src="{{ $src or 'http://placehold.it/100x100' }}" alt="{{ $title or 'Image alt' }}" title="{{ $title or 'Image title' }}"/>
@endtemplate

<div>
    @render('img')
</div>
<div>
    @render('img', ['src' => 'http://placehold.it/350x350', 'title' => 'Large placeholder'])
</div>
<div>
    @render('img', ['src' => 'http://placehold.it/32x32', 'title' => 'Tiny placeholder'])
</div>