PHP code example of dowilcox / blade-view

1. Go to this page and download the library: Download dowilcox/blade-view 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/ */

    

dowilcox / blade-view example snippets


Plugin::load('BladeView', ['bootstrap' => false]);

public $viewClass = '\Dowilcox\BladeView\View\BladeView';

 echo h($variable); 

{{{ $variable }}}

 echo $this->fetch(); 

@fetch()

 echo $this->Html->css(); 

@html->css()

{{-- src/Template/Common/view.blade.php --}}
<h1>@fetch('title')</h1>
@fetch('content')

<div class="actions">
    <h3>Related actions</h3>
    <ul>
    @fetch('sidebar')
    </ul>
</div>

{{-- src/Template/Posts/view.blade.php --}}
@extend('/Common/view')

@assign('title', $post)

@start('sidebar')
<li>
    @html->link('edit', [
        'action' => 'edit',
        $post['Post']['id']
    ])
</li>
@end()

{{-- The remaining content will be available as the 'content' block --}}
{{-- In the parent view. --}}
{{{ $post['Post']['body'] }}}