Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call template with nice fetch method #20

Merged
merged 1 commit into from Sep 29, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion controllers/front/verification.php
Expand Up @@ -47,6 +47,6 @@ public function initContent()
parent::initContent();

$this->context->smarty->assign('message', $this->message);
$this->setTemplate('verification_execution.tpl');
$this->setTemplate('module:ps_emailsubscription/views/templates/front/verification_execution.tpl');
}
}
10 changes: 2 additions & 8 deletions ps_emailsubscription.php
Expand Up @@ -782,15 +782,9 @@ protected function sendVerificationEmail($email, $token)

public function renderWidget($hookName = null, array $configuration = [])
{
$cacheId = $this->getCacheId();
if (Tools::isSubmit('submitNewsletter') || !$this->isCached('ps_emailsubscription.tpl', $cacheId)) {
$this->smarty->assign($this->getWidgetVariables($hookName, $configuration));
}
if (Tools::isSubmit('submitNewsletter')) {
$cacheId = null;
}
$this->smarty->assign($this->getWidgetVariables($hookName, $configuration));

return $this->display(__FILE__, 'ps_emailsubscription.tpl', $cacheId);
return $this->fetch('module:ps_emailsubscription/views/templates/hook/ps_emailsubscription.tpl');
}

public function getWidgetVariables($hookName = null, array $configuration = [])
Expand Down
7 changes: 6 additions & 1 deletion views/templates/front/verification_execution.tpl
Expand Up @@ -22,4 +22,9 @@
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{$message}
{extends file='page.tpl'}

{block name="page_content"}
{$message}
{/block}