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

Smarty5: {config_load config variables not available in all templates #993

Closed
blaaat opened this issue Apr 12, 2024 · 1 comment · Fixed by #1004
Closed

Smarty5: {config_load config variables not available in all templates #993

blaaat opened this issue Apr 12, 2024 · 1 comment · Fixed by #1004

Comments

@blaaat
Copy link

blaaat commented Apr 12, 2024

Consider the following files:

test.cfg:

test="Hi"

test.html

{include file='test2.html'}

{#test#}-test.html

test2.html

{config_load file='test.cfg' scope='parent'}
{#test#}-test2.html

test.php

$smarty->display('test.html');

Smarty4 output:

Hi-test2.html
Hi-test.html

Smarty5 output:

Hi-test2.html
-test.html

Also with scope='global' in config_load this case is not working.

Is it supposed to be like this? (and should I call config_load in every template that uses the variables? or is this inefficient?)

@blaaat
Copy link
Author

blaaat commented Apr 12, 2024

In the changelog this change is mentioned, but in the docs the scope is still there.

https://smarty-php.github.io/smarty/stable/designers/language-builtin-functions/language-function-config-load/#attributes

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

Successfully merging a pull request may close this issue.

1 participant