32 lines
597 B
PHP
32 lines
597 B
PHP
<?php
|
|
|
|
/*
|
|
* Smarty plugin
|
|
* -------------------------------------------------------------
|
|
* Type: function
|
|
* Name: get_slider
|
|
* Purpose: get a slider of known name or id
|
|
* -------------------------------------------------------------
|
|
*/
|
|
/**
|
|
* @param array $params
|
|
* @param Smarty $smarty
|
|
*
|
|
* @return array
|
|
*/
|
|
function smarty_function_get_datetime($params, &$smarty)
|
|
{
|
|
$assign = null;
|
|
$value = 'now';
|
|
|
|
extract($params);
|
|
|
|
$ret = new DateTime($value);
|
|
|
|
if (!empty($assign)) {
|
|
$smarty->assign($assign, $ret);
|
|
} else {
|
|
return $ret;
|
|
}
|
|
}
|