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

How to use variables in include? #34

Open
atr-one opened this issue Nov 28, 2018 · 1 comment
Open

How to use variables in include? #34

atr-one opened this issue Nov 28, 2018 · 1 comment

Comments

@atr-one
Copy link

atr-one commented Nov 28, 2018

I try to use this template code (for Node JS):

res.render('index', {fname: 'include.smarty'});

{include file="$fname"}

Result:

Error: ENOENT: no such file or directory, open 'C:\OSPanel\domains\express\partials\$fname'

If I use it like this:

{include file="include.smarty"}

Returns normal response.

What could be the problem when using variables in include?

@peon501
Copy link

peon501 commented Mar 15, 2019

this plugin does not cover it. You need to write your own code for that. I had this problem and I just rewrote some functions.

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