本文整理汇总了PHP中Zikula_View::__f方法的典型用法代码示例。如果您正苦于以下问题:PHP Zikula_View::__f方法的具体用法?PHP Zikula_View::__f怎么用?PHP Zikula_View::__f使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zikula_View
的用法示例。
在下文中一共展示了Zikula_View::__f方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: smarty_function_reviewsTemplateHeaders
/**
* The reviewsTemplateHeaders plugin performs header() operations
* to change the content type provided to the user agent.
*
* Available parameters:
* - contentType: Content type for corresponding http header.
* - asAttachment: If set to true the file will be offered for downloading.
* - filename: Name of download file.
*
* @param array $params All attributes passed to this function from the template.
* @param Zikula_View $view Reference to the view object.
*
* @return boolean false.
*/
function smarty_function_reviewsTemplateHeaders($params, $view)
{
if (!isset($params['contentType'])) {
$view->trigger_error($view->__f('%1$s: missing parameter \'%2$s\'', array('reviewsTemplateHeaders', 'contentType')));
}
// apply header
header('Content-Type: ' . $params['contentType']);
// if desired let the browser offer the given file as a download
if (isset($params['asAttachment']) && $params['asAttachment'] && isset($params['filename']) && !empty($params['filename'])) {
header('Content-Disposition: attachment; filename=' . $params['filename']);
}
return;
}