PHP code example of hex-digital / sage-blade-block-renderer

1. Go to this page and download the library: Download hex-digital/sage-blade-block-renderer 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/ */

    

hex-digital / sage-blade-block-renderer example snippets




namespace Example;

use BladeBlock\BladeBlock;

class Example extends BladeBlock
{
    /**
     * The block slug. Should match the slug given to your registered block.
     *
     * @var string
     */
    public $slug = 'example';

    /**
     * Data to be passed to the block before rendering.
     *
     * @param BladeBlock $block
     * @return array
     */
    public function with($block)
    {
        return [
            'data' => 'dummy data',
        ];
    }
}

/**
 * The block prefix. Should match the prefix given to your block
 *
 * @var string
 */
public $prefix = 'hex/';

/**
 * The block slug. Should match the slug given to your registered block.
 *
 * @var string
 */
public $slug = '';

/**
 * The block view. Same format as given to the blade `