overbags Posted May 15, 2021 Share Posted May 15, 2021 (edited) hi everyone i'm trying to modify a tpl page and i have to insert in a div a text composed of several php variables the problem is that I can't do the chaining I post an example of how I would do it in a php file to make you understand but that in tpl it does not work {$name_lastname = $firstname . " " . $lastname} <div> {$name_lastname} </div> I need it to result in a single variable ... I know I could do {$firstname} {$lastname} Edited May 15, 2021 by overbags (see edit history) Link to comment Share on other sites More sharing options...
ventura Posted May 15, 2021 Share Posted May 15, 2021 It is always recommended that variables of this kind be generated in the controller. To generate them in the .tpl you can try like this {assign var='name_lastname' value="{$firstname}{' '}{$lastname}"} 1 Link to comment Share on other sites More sharing options...
overbags Posted May 15, 2021 Author Share Posted May 15, 2021 thank you very much ... it works well Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now