mirror of
https://github.com/smarty-php/smarty.git
synced 2026-08-11 07:51:32 +02:00
20 lines
527 B
PHP
20 lines
527 B
PHP
<?php
|
|||
|
|
namespace Smarty\Compile\Modifier;
|
||
|
|
/**
|
||
|
|
* Smarty upper modifier plugin
|
||
|
|
* Type: modifier
|
||
|
|
* Name: lower
|
||
|
|
* Purpose: convert string to uppercase
|
||
|
|
*
|
||
|
|
* @link https://www.smarty.net/manual/en/language.modifier.upper.php lower (Smarty online manual)
|
||
|
|
* @author Uwe Tews
|
||
|
|
*/
|
||
|
|
|
||
|
|
class UpperModifierCompiler extends Base {
|
||
|
|
|
||
|
|
public function compile($params, \Smarty\Compiler\Template $compiler) {
|
||
|
|
return 'mb_strtoupper((string) ' . $params[ 0 ] . ' ?? \'\', \'' . addslashes(\Smarty\Smarty::$_CHARSET) . '\')';
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|