blob: 0e66bb521104f46abcc4857bc2b41fe46e9c55d1 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
<?php
namespace Smarty\Compile\Modifier;
use Smarty\CompilerException;
/**
* Smarty is_array modifier plugin
*/
class IsArrayModifierCompiler extends Base {
public function compile($params, \Smarty\Compiler\Template $compiler) {
if (count($params) !== 1) {
throw new CompilerException("Invalid number of arguments for is_array. is_array expects exactly 1 parameter.");
}
return 'is_array(' . $params[0] . ')';
}
}
|