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

Upgrading from 3.1.11 to 3.1.31 #419

Closed
zerocarbthirty opened this issue Jan 12, 2018 · 2 comments
Closed

Upgrading from 3.1.11 to 3.1.31 #419

zerocarbthirty opened this issue Jan 12, 2018 · 2 comments

Comments

@zerocarbthirty
Copy link

zerocarbthirty commented Jan 12, 2018

Hello, I am upgrading an application which uses Smarty from 3.1.11 to 3.1.31 and I am having an odd problem. I have a class for my application which uses Smarty.

<?php
require_once('smarty_new/Smarty.class.php');
class lsmarty extends Smarty {
    function __construct( ) {
        parent::__construct();
        $lang = "en_us";
	$this->left_delimiter = '{{';
	$this->right_delimiter = '}}';
	$this->force_compile = true;
	$this->setTemplateDir('tpls/'.$lang);
	$this->setConfigDir('configs/');
	$this->setCompileDir('cache/smarty_templates_c/');
	$this->setCacheDir('cache/smarty_cache/');
	$this->caching = Smarty::CACHING_OFF;

Here is one of the php scripts:

<?php
require_once('lsmarty.class.php');
$smarty = new lsmarty( );
$smarty->assign('reason', $reason);
$smarty->display('extends:login.tpl');

When requring the new version of Smarty the output is simply:

{extends file='extends:login.tpl' extends_resource=true}

When requiring the original version the output is the page as expected.

Any ideas?

@uwetews
Copy link
Contributor

uwetews commented Mar 16, 2018

The fix is now in the master branch and will later be included in 3.1.32

However using the extends: resource with a sigle template file is not needed and does create overhead.

Just use

$smarty->display('login.tpl');

@uwetews uwetews closed this as completed Mar 16, 2018
@zerocarbthirty
Copy link
Author

zerocarbthirty commented Mar 20, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants