PHP code example of icanboogie / render

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

    

icanboogie / render example snippets




/* @var ICanBoogie\Render\PHPEngine $engine */
/* @var string $template_pathname */
/* @var mixed $content */
/* @var array<string, mixed> $variables */

$rendered = $engine->render($template_pathname, $content, $variables);



use ICanBoogie\Render\EngineProvider\Immutable;
use ICanBoogie\Render\PHPEngine;

$engines = new Immutable([ '.php' => new PHPEngine() ]);
echo $engines->engine_for_extension('.php')::class; // ICanBoogie\Render\PHPEngine



/* @var EngineProvider $engines */

$extensions = array_keys(iterator_to_array($engines));

echo implode(', ', $extensions); // .php