本文整理匯總了PHP中Translator::decorateTemplate方法的典型用法代碼示例。如果您正苦於以下問題:PHP Translator::decorateTemplate方法的具體用法?PHP Translator::decorateTemplate怎麽用?PHP Translator::decorateTemplate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Translator
的用法示例。
在下文中一共展示了Translator::decorateTemplate方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Translator
$tpl->template_dir = Config::get_config('install_path') . 'templates';
$tpl->compile_dir = ConfusaConstants::$SMARTY_TEMPLATES_C;
$tpl->cache_dir = ConfusaConstants::$SMARTY_CACHE;
$subscriber = $person->getSubscriber();
if (isset($subscriber)) {
$help_email = $subscriber->getHelpEmail();
$tpl->assign('help_email', $help_email);
}
$tpl->assign('consent_val', $consent_val);
$tpl->assign('consumer_key', $consumer_key);
$tpl->assign('consumer_name', $consumer_info['name']);
$tpl->assign('consumer_description', $consumer_info['description']);
$tpl->assign('access_duration', $accTokenValidity);
$translator = new Translator();
$translator->guessBestLanguage($person);
$translator->decorateTemplate($tpl, 'oauth');
$tpl->display('api/oauth_consent.tpl');
break;
case '/consent':
$person = new Person();
$auth_idp = new Confusa_Auth_IdP($person);
$auth_idp->authenticate(FALSE);
if (!$person->isAuth()) {
header("HTTP/1.1 412 Precondition Failed");
echo "May not call the consent endpoint before the user " . "authenticated with their IdP!";
exit;
}
if ($_SESSION['oauth_authZ'] !== TRUE) {
header("HTTP/1.1 412 Precondition Failed");
echo "May not call the consent endpoint before the user " . "passed the authorization endpoint!";
exit;