本文整理汇总了PHP中CRM_Core_Smarty::get_template_vars方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_Smarty::get_template_vars方法的具体用法?PHP CRM_Core_Smarty::get_template_vars怎么用?PHP CRM_Core_Smarty::get_template_vars使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Core_Smarty
的用法示例。
在下文中一共展示了CRM_Core_Smarty::get_template_vars方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: smarty_block_ts
/**
* Smarty block function providing gettext support
*
* See CRM_Core_I18n class documentation for details.
*
* @param array $params
* Template call's parameters.
* @param string $text
* {ts} block contents from the template.
* @param CRM_Core_Smarty $smarty
* The Smarty object.
*
* @return string
* the string, translated by gettext
*/
function smarty_block_ts($params, $text, &$smarty)
{
if (!isset($params['domain'])) {
$params['domain'] = $smarty->get_template_vars('extensionKey');
}
return ts($text, $params);
}
示例2: smarty_function_help
/**
* Adds inline help
*
* @param array $params
* The function params.
* @param CRM_Core_Smarty $smarty
* Reference to the smarty object.
*
* @return string
* the help html to be inserted
*/
function smarty_function_help($params, &$smarty)
{
if (!isset($params['id']) || !isset($smarty->_tpl_vars['config'])) {
return NULL;
}
if (empty($params['file']) && isset($smarty->_tpl_vars['tplFile'])) {
$params['file'] = $smarty->_tpl_vars['tplFile'];
} elseif (empty($params['file'])) {
return NULL;
}
$params['file'] = str_replace(array('.tpl', '.hlp'), '', $params['file']);
if (empty($params['title'])) {
$vars = $smarty->get_template_vars();
$smarty->assign('id', $params['id'] . '-title');
$name = trim($smarty->fetch($params['file'] . '.hlp'));
$additionalTPLFile = $params['file'] . '.extra.hlp';
if ($smarty->template_exists($additionalTPLFile)) {
$name .= trim($smarty->fetch($additionalTPLFile));
}
// Ensure we didn't change any existing vars CRM-11900
foreach ($vars as $key => $value) {
if ($smarty->get_template_vars($key) !== $value) {
$smarty->assign($key, $value);
}
}
} else {
$name = trim(strip_tags($params['title']));
}
$class = "helpicon";
if (!empty($params['class'])) {
$class .= " {$params['class']}";
}
// Escape for html
$title = htmlspecialchars(ts('%1 Help', array(1 => $name)));
// Escape for html and js
$name = htmlspecialchars(json_encode($name), ENT_QUOTES);
// Format params to survive being passed through json & the url
unset($params['text'], $params['title']);
foreach ($params as &$param) {
$param = is_bool($param) || is_numeric($param) ? (int) $param : (string) $param;
}
return '<a class="' . $class . '" title="' . $title . '" href="#" onclick=\'CRM.help(' . $name . ', ' . json_encode($params) . '); return false;\'> </a>';
}
示例3: get_template_vars
/**
* Returns an array containing template variables.
*
* @param string $name
*
* @return array
*/
public function get_template_vars($name = NULL)
{
return self::$_template->get_template_vars($name);
}
示例4:
/**
* Returns an array containing template variables
*
* @param string $name
* @param string $type
* @return array
*/
function get_template_vars($name = null)
{
return self::$_template->get_template_vars($name);
}