本文整理汇总了PHP中Template_Helper::displayTemplate方法的典型用法代码示例。如果您正苦于以下问题:PHP Template_Helper::displayTemplate方法的具体用法?PHP Template_Helper::displayTemplate怎么用?PHP Template_Helper::displayTemplate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Template_Helper
的用法示例。
在下文中一共展示了Template_Helper::displayTemplate方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: rssError
function rssError($msg)
{
$tpl = new Template_Helper();
$tpl->setTemplate('rss_error.tpl.xml');
header('Content-Type: text/xml; charset=' . APP_CHARSET);
$tpl->assign(array('error' => $msg));
$tpl->displayTemplate();
}
示例2: array
/*
* This file is part of the Eventum (Issue Tracking System) package.
*
* @copyright (c) Eventum Team
* @license GNU General Public License, version 2 or later (GPL-2+)
*
* For the full copyright and license information,
* please see the COPYING and AUTHORS files
* that were distributed with this source code.
*/
require_once __DIR__ . '/../../init.php';
Auth::checkAuthentication();
if (!empty($_REQUEST['iss_id'])) {
$fields = Custom_Field::getListByIssue(Auth::getCurrentProject(), $_REQUEST['iss_id']);
} else {
$fields = Custom_Field::getListByProject(Auth::getCurrentProject(), $_REQUEST['form_type']);
}
$data = array();
foreach ($fields as $field) {
$backend = Custom_Field::getBackend($field['fld_id']);
if (is_object($backend) && is_subclass_of($backend, 'Dynamic_Custom_Field_Backend')) {
$field['structured_data'] = $backend->getStructuredData();
$data[] = $field;
}
}
header('Content-Type: text/javascript; charset=UTF-8');
$tpl = new Template_Helper();
$tpl->setTemplate('js/dynamic_custom_field.tpl.js');
$tpl->assign('fields', $data);
$tpl->displayTemplate();
示例3: displayErrorMessage
public static function displayErrorMessage($msg)
{
self::setMessage($msg, self::MSG_ERROR);
$tpl = new Template_Helper();
$tpl->setTemplate('error_message.tpl.html');
$tpl->displayTemplate();
exit;
}
示例4: checkPermissions
$relative_url[] = '';
$relative_url = implode('/', $relative_url);
define('APP_REL_URL', $relative_url);
$tpl->assign('phpversion', phpversion());
$tpl->assign('core', array('rel_url' => $relative_url, 'app_title' => APP_NAME));
if (@$_SERVER['HTTPS'] == 'on') {
$ssl_mode = 'enabled';
} else {
$ssl_mode = 'disabled';
}
$tpl->assign('ssl_mode', $ssl_mode);
$tpl->assign('zones', Date_Helper::getTimezoneList());
$tpl->assign('default_timezone', getTimezone());
$tpl->assign('default_weekday', getFirstWeekday());
$tpl->setTemplate('setup.tpl.html');
$tpl->displayTemplate(false);
/**
* Checks for $file for write permission.
*
* IMPORTANT: if the file does not exist, an empty file is created.
*/
function checkPermissions($file, $desc, $is_directory = false)
{
clearstatcache();
if (!file_exists($file)) {
if (!$is_directory) {
// try to create the file ourselves then
$fp = @fopen($file, 'w');
if (!$fp) {
return getPermissionError($file, $desc, $is_directory, false);
}
示例5: getAuthBackend
/**
* @return Auth_Backend_Interface
*/
public static function getAuthBackend()
{
/** @var Auth_Backend_Interface $instance */
static $instance = false;
if ($instance == false) {
$class = APP_AUTH_BACKEND;
// legacy: allow lowercase variants
if (strtolower($class) == 'mysql_auth_backend') {
$class = 'Mysql_Auth_Backend';
} elseif (strtolower($class) == 'ldap_auth_backend') {
$class = 'LDAP_Auth_Backend';
}
try {
$instance = new $class();
} catch (AuthException $e) {
$message = "Unable to use auth backend '{$class}'";
Logger::app()->critical($message, array('exception' => $e));
if (APP_AUTH_BACKEND_ALLOW_FALLBACK != true) {
$tpl = new Template_Helper();
$tpl->setTemplate('authentication_error.tpl.html');
$tpl->assign('error_message', $e->getMessage());
$tpl->displayTemplate();
exit;
}
$instance = self::getFallBackAuthBackend();
}
}
return $instance;
}