本文整理汇总了PHP中Template::getTemplate方法的典型用法代码示例。如果您正苦于以下问题:PHP Template::getTemplate方法的具体用法?PHP Template::getTemplate怎么用?PHP Template::getTemplate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Template
的用法示例。
在下文中一共展示了Template::getTemplate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
public function render($template, $_vars = array(), $fetch = false)
{
$tpl = new Template($template);
$this->addVars($_vars);
foreach ($this->vars as $key => $var) {
$tpl->assign($key, $var);
}
if ($fetch === true) {
return $tpl->fetch($tpl->getTemplate());
}
$tpl->display($tpl->getTemplate());
return true;
}
示例2: actionCreate
/**
* Creates a new model.
* If creation is successful, the browser will be redirected to the 'view' page.
*/
public function actionCreate()
{
$model = new Users();
$this->performAjaxValidation($model);
if (isset($_POST['Users'])) {
$model->attributes = $_POST['Users'];
$model->user_created_by_id = $this->user_data['user_id'];
$passwod = $model->user_password;
$model->user_password = md5($passwod);
$userdata['user_name'] = $model->user_name;
$userdata['user_email'] = $model->user_email;
$userdata['user_password'] = $passwod;
$userdata['login_url'] = Utils::getBaseUrl() . "/auth";
$userdata['website_url'] = Utils::getBaseUrl();
$template = Template::getTemplate('log-in_mail_template');
$subject = $template->template_subject;
$message = $template->template_content;
$subject = $this->replace($userdata, $subject);
$message = $this->replace($userdata, $message);
if (Yii::app()->session['user_data']['user_role_type'] == 3) {
$model->user_role_type = 4;
$model->user_department_id = Yii::app()->session['user_data']['user_department_id'];
}
if ($model->save()) {
$this->SendMail($model->user_email, $model->user_name, $subject, $message);
Yii::app()->user->setFlash('type', 'success');
Yii::app()->user->setFlash('message', 'User added successfully.');
} else {
Yii::app()->user->setFlash('type', 'danger');
Yii::app()->user->setFlash('message', 'Operation failded due to lack of connectivity. Try again later!!!');
}
$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('index'));
}
$this->render('create', array('model' => $model));
}
示例3: render
public function render()
{
// $content = '';
// ob_start();
// include Template::getTemplate(get_class($this));
// $content = ob_get_clean();
include Template::getTemplate('Layouts' . DIRECTORY_SEPARATOR . $this->getLayoutTemplate());
}
示例4: _displayNL2GocheckBox
function _displayNL2GocheckBox($data)
{
global $xtPlugin, $xtLink, $db;
$tpl = 'newsletter_checkbox.html';
$tpl_data = array();
$template = new Template();
$template->getTemplatePath($tpl, 'xt_newsletter2go', '', 'plugin');
$tmp_data = $template->getTemplate('xt_newsletter2go_smarty', $tpl, $tpl_data);
return $tmp_data;
}
开发者ID:newsletter2go,项目名称:newsletter2go-xtcommerce-extension,代码行数:10,代码来源:login_create_account_tpl.php
示例5: render
public function render()
{
// $content = '';
// foreach($this as $item) {
// $content .= $item->render();
// }
ob_start();
include Template::getTemplate(get_class($this));
return ob_get_clean();
}
示例6: _displayNL2GocheckBox
function _displayNL2GocheckBox($data)
{
global $xtPlugin, $xtLink, $db;
$table = TABLE_CUSTOMERS;
$customer_id = $_SESSION['customer']->customers_id;
$result = $db->getOne("SELECT nl2go_newsletter_status FROM {$table} WHERE customers_id= {$customer_id}");
$tpl = 'newsletter_checkbox_checkout.html';
$tpl_data = array('newsletter2go' => $result);
$template = new Template();
$template->getTemplatePath($tpl, 'xt_newsletter2go', '', 'plugin');
$tmp_data = $template->getTemplate('xt_newsletter2go_smarty', $tpl, $tpl_data);
return $tmp_data;
}
示例7: render
public function render()
{
ob_start();
include Template::getTemplate($this->_type->name);
return ob_get_clean();
}
示例8: siteClose
public function siteClose()
{
if (Config::$site_allowed == false) {
echo Template::getTemplate("site_close");
}
}
示例9: template
/**
* Template
* Retorna un elemento de la plantilla del sitio web
*
* @param string $template Nombre del elemento de plantilla
* @param string $path Ruta de plantilla
* @param string $prefix Prefijo de archivos de plantilla
*
* @return string
* ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
* @author Luis Gdonis <ldonis.emc2@gmail.com>
* @since 2.0.0.0-alpha
*/
public function template($template, $path = 'Template', $prefix = 'template')
{
/*
* Todo elemento de plantilla de terminar,
* con .template.php o el prefijo establecido
*/
if ($prefix) {
$template = $prefix . '.' . $template;
}
/*
* Se utiliza el administrador de plantillas
* para obtener la ruta
*/
return Template::getTemplate($template, $path);
}
示例10: die
<?php
defined('_VALID_CALL') or die('Direct Access is not allowed.');
if ($_SESSION['selected_payment'] == 'xt_paymill') {
$paymill = new xt_paymill();
$tpl = $_SESSION['selected_payment_sub'] . '.html';
$pluginTemplate = new Template();
$pluginTemplate->getTemplatePath($tpl, 'xt_paymill', '', 'plugin');
echo $pluginTemplate->getTemplate('', $tpl, $paymill->data);
}
示例11: testFromINILoadFallback
/**
* @group default
* @testFromINIWithName
*/
public function testFromINILoadFallback()
{
// precondition
$this->assertNull(Template::getTemplate('testFromINILoadFallbackFallback'));
$expected = ['vcard' => 'content'];
$template = Template::fromINI(__DIR__ . '/templates/testFromINILoadFallback.ini');
$this->assertNotNull($template);
$this->assertEquals('testFromINILoadFallback', $template->getName());
$fragments = $template->getFragments();
$this->assertNotNull($fragments);
$this->assertEquals($expected, $fragments);
$this->assertNotNull($template->getFallback());
$this->assertSame(Template::getTemplate('testFromINILoadFallbackFallback'), $template->getFallback());
$registeredTemplate = Template::getTemplate('testFromINILoadFallback');
$this->assertSame($template, $registeredTemplate);
}
示例12: actionRecover_password
public function actionRecover_password()
{
$this->layout = 'login_layout';
$model = new ForgetPassword();
if (isset($_POST['ForgetPassword']['username'])) {
$email = $_POST['ForgetPassword']['username'];
$user_details = Users::model()->findByAttributes(array(trim('user_email') => trim($_POST['ForgetPassword']['username'])));
// print_r($user_details);
// die;
if (!empty($user_details)) {
$userdata['user_name'] = $user_details->user_name;
$userdata['user_email'] = $user_details->user_email;
$code = base64_encode($user_details->user_email);
$userdata['link_to_reset_password'] = Utils::getBaseUrl() . "/auth/setPassword?code=" . $code;
$userdata['link_expiry_time'] = 30;
$template = Template::getTemplate('forgot_password_email_template');
$subject = $template->template_subject;
$message = $template->template_content;
$subject = $this->replace($userdata, $subject);
$message = $this->replace($userdata, $message);
$user_details->forgot_password_code = $code;
$user_details->forgot_pass_code_expiry = date('Y-m-d H:i:s');
if ($user_details->update()) {
$this->SendMail($user_details->user_email, $user_details->user_name, $subject, $message);
Yii::app()->user->setFlash('type', 'success');
Yii::app()->user->setFlash('message', '\'Reset Password\' link has been sent on your requested Email ID successfully.');
} else {
Yii::app()->user->setFlash('type', 'danger');
Yii::app()->user->setFlash('message', 'Operation failded due to lack of connectivity. Try again later!!!');
}
} else {
Yii::app()->user->setFlash('type', 'danger');
Yii::app()->user->setFlash('message', 'This Email ID doesn\'t exist. Please enter a valid Email ID.');
}
}
$this->render('recover_password', array('model' => $model));
}
示例13: ApprovePilot
/**
* PilotAdmin::ApprovePilot()
*
* @return
*/
protected function ApprovePilot()
{
PilotData::AcceptPilot($this->post->id);
RanksData::CalculatePilotRanks();
$pilot = PilotData::getPilotData($this->post->id);
# Send pilot notification
$subject = Lang::gs('email.register.accepted.subject');
$this->set('pilot', $pilot);
$oldPath = Template::setTemplatePath(TEMPLATES_PATH);
$oldSkinPath = Template::setSkinPath(ACTIVE_SKIN_PATH);
$message = Template::getTemplate('email_registrationaccepted.tpl', true, true, true);
Template::setTemplatePath($oldPath);
Template::setSkinPath($oldSkinPath);
Util::SendEmail($pilot->email, $subject, $message);
CodonEvent::Dispatch('pilot_approved', 'PilotAdmin', $pilot);
LogData::addLog(Auth::$userinfo->pilotid, 'Approved ' . PilotData::getPilotCode($pilot->code, $pilot->pilotid) . ' - ' . $pilot->firstname . ' ' . $pilot->lastname);
}
示例14: foreach
foreach ($letterFolders as &$f) {
$f['contents'] = $template->getTemplatesInFolder($f['folder_id']);
$f['content_count'] = $template->getCountTemplatesInFolder($f['folder_id']);
}
unset($f);
$emailTemplates = $template->getTemplates('email', 0);
$letterTemplates = $template->getTemplates('letter', 0);
$l10n->addResource(__DIR__ . '/l10n/templates.json');
$viewFile = 'views/templates.php';
} elseif ($_GET['page'] === "create") {
$template->insertTemplate($_POST);
$loggers['audit']->info("Template created");
header('location:templates.php');
exit;
} elseif ($_GET['page'] === "fetch") {
$content = $template->getTemplate($_GET['templateid']);
$content[0]['content'] = htmlspecialchars_decode($content[0]['content']);
header('Content-Type: application/json; charset=utf-8');
echo json_encode($content);
exit;
} elseif ($_GET['page'] === "update-folder") {
$content = $template->updateFolder($_POST['template_id'], $_POST['folder_id']);
$loggers['audit']->info("Template {$_POST['template_id']} moved to folder {$_POST['folder_id']}");
} elseif ($_GET['page'] === "delete") {
$template->hideTemplate($_GET['id']);
$loggers['audit']->info("Template {$_GET['id']} deleted");
header('location:templates.php');
exit;
} elseif ($_GET['page'] === 'insert-or-update-folder') {
if (empty($_POST['folder_id'])) {
//Add a new folder
示例15: actionEmailChangeTicketStatus
function actionEmailChangeTicketStatus()
{
$template = Template::getTemplate('ticket_status_changed_mail_template_');
$subject = $template->template_subject;
$message = $template->template_content;
$results = TicketChangeLog::model()->findAllByAttributes(array(), array('condition' => 'send_mail = :send_mail', 'params' => array('send_mail' => 0)));
foreach ($results as $users) {
$userdata['user_by'] = Users::model()->getUserName($users->user_id);
$userInfo = Users::model()->findByPk($user->fwd_to);
$ticket_id = $users->ticket_id;
$remark = $users->remark;
$userdata['user_by'] = Users::model()->getUserName($users->user_id);
$userdata['remark'] = $remark;
$userdata['ticket_status_name'] = TicketStatus::model()->getStatusName($users->status_id);
$userdata['ticket_id'] = $ticket_id;
$userdata['ticket_link'] = Utils::getBaseUrl() . "/ticket/view/" . base64_encode($ticket_id);
$assignee = TicketAssign::model()->findAllByAttributes(array(), array('condition' => 'ticket_id = :ticket_id AND fwd_to !=:user_id AND status=1 ', 'params' => array('ticket_id' => $ticket_id, user_id => $users->user_id)));
$assigneeby = TicketAssign::model()->findAllByAttributes(array(), array('condition' => 'ticket_id = :ticket_id AND fwd_by !=:user_id AND status=1 ', 'params' => array('ticket_id' => $ticket_id, user_id => $users->user_id), 'group' => "fwd_by"));
// For Assignee mail
foreach ($assignee as $user) {
$userInfo = Users::model()->findByPk($user->fwd_to);
$userdata['user_name'] = $userInfo->user_name;
$subject = $this->replace($userdata, $subject);
$message = $this->replace($userdata, $message);
$this->SendMail($userInfo->user_email, $userInfo->user_name, $subject, $message);
}
// this is fowwarded by
foreach ($assigneeby as $user) {
$userInfo = Users::model()->findByPk($user->fwd_by);
$userdata['user_name'] = $userInfo->user_name;
$subject = $this->replace($userdata, $subject);
$message = $this->replace($userdata, $message);
$this->SendMail($userInfo->user_email, $userInfo->user_name, $subject, $message);
}
$model = TicketChangeLog::model()->findByPk($users->id);
$model->send_mail = 1;
$model->update();
}
}