PHP code example of fcog / fractal-handlebars-php

1. Go to this page and download the library: Download fcog/fractal-handlebars-php 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/ */

    

fcog / fractal-handlebars-php example snippets


$view_engine = new Renderer(
    get_template_directory() . '/component-library/',
    get_template_directory_uri() . '/component-library/assets'
);

// In some template file
$view_engine->render('@fractal-component-handle', ['data_prop' => 'value']);