本文整理匯總了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;
}