mirror of
https://github.com/smarty-php/smarty.git
synced 2025-11-18 16:39:24 +01:00
* Prevent deprecation notices for implode, json_encode and substr modifiers. * unit tests
12 lines
250 B
PHP
12 lines
250 B
PHP
<?php
|
|
|
|
/**
|
|
* Smarty plugin
|
|
*
|
|
* @package Smarty
|
|
* @subpackage PluginsModifierCompiler
|
|
*/
|
|
function smarty_modifiercompiler_json_encode($params) {
|
|
return 'json_encode(' . $params[0] . (isset($params[1]) ? ', (int) ' . $params[1] : '') . ')';
|
|
}
|