Skip to content

How to use variables in include? #34

@atr-one

Description

@atr-one

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions