getblocklab / block-lab

A WordPress Admin interface and a simple templating system for building custom Gutenberg blocks.
https://getblocklab.com
GNU General Public License v2.0
416 stars 63 forks source link

Blade rendering engine for blocks #451

Open guzart opened 4 years ago

guzart commented 4 years ago

Hello 👋,

We are currently using Sage WordPress Theme which uses Laravel's Blade Templates. It would be amazing to be able to extend Block Lab to use any custom rendering engine.

So far I am able to render our Blade components with the following /blocks/button/block.php:

<?php
    $template_path = get_stylesheet_directory() . '/views/components/button/index.blade.php';
    echo \App\template($template_path, [
        'slot' => block_value('text'),
    ]);
lukecarbis commented 4 years ago

Hey @guzart – that's super interesting. I've come across this once before. We'll definitely have to take a closer look into how Blade Templates could work with Block Lab.