PHP code example of carbontwelve / slim-plates

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

    

carbontwelve / slim-plates example snippets


use Carbontwelve\SlimPlates\PlatesViewProvider;

        'renderer' => [
            'template_path' => realpath(__DIR__.'/views'),
            'template_ext' => 'phtml'
        ]
    ])
);
$container = $app->getContainer();
$container->register(new Carbontwelve\SlimPlates\PimplePlatesViewProvider());

$app->get('/hello/{name}', function ($request, $response, $args) {
    return $this->renderer->render($response, "/hello.phtml", $args);
});

$app->run();

$yourData = [];
$platesRenderer = new Carbontwelve\SlimPlates\PlatesRenderer('./path/to/templates', 'phtml');
$response = $platesRenderer->render(new Response(), 'template', $yourData)