PHP code example of canteen / parser

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

    

canteen / parser example snippets




use Canteen\Parser\Parser;
$parser = new Parser();

// Load an optional list of templates
$parser->addTemplate('MyTemplate', 'MyTemplate.html');

// Render the template with some substitutions
echo $parser->template(
	'MyTemplate',
	[
		'title' => 'My Page',
		'description' => 'Description goes here!'
	]
);