PHP code example of dqneo / smarty-delimiter-converter
1. Go to this page and download the library: Download dqneo/smarty-delimiter-converter 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/ */
dqneo / smarty-delimiter-converter example snippets
use DQNEO\SmartyDelimiterConverter\Converter;
// define delimiters
$from = ['{', '}'];
$to = ['{{', '}}'];
$converter = new Converter($from, $to);
// convert a content
$converted = $converter->convert('hello {$name}'); // => 'hello {{$name}}'
# convert a file
$converted = $converter->convert('/path/to/file.tpl'); // returns a converted content