mirror of
https://github.com/smarty-php/smarty.git
synced 2025-10-23 01:11:36 +02:00
25 lines
523 B
PHP
25 lines
523 B
PHP
![]() |
<?php
|
||
|
/**
|
||
|
* Smarty plugin getvar
|
||
|
*
|
||
|
* @package Smarty
|
||
|
* @subpackage PHPunitPlugin
|
||
|
*/
|
||
|
|
||
|
/**
|
||
|
* Smarty {getvar}
|
||
|
*
|
||
|
* @param array $params parameter array
|
||
|
* @param object $template template object
|
||
|
*
|
||
|
* @return string
|
||
|
*/
|
||
|
function smarty_function_getvar($params, Smarty_Internal_Template $template)
|
||
|
{
|
||
|
if (isset($params[ 'assign' ])) {
|
||
|
$template->assign($params[ 'assign' ], $template->getTemplateVars($params[ 'var' ]));
|
||
|
} else {
|
||
|
return $template->getTemplateVars($params[ 'var' ]);
|
||
|
}
|
||
|
}
|