L
L
lexstile2017-11-07 17:48:07
PHP
lexstile, 2017-11-07 17:48:07

How to concatenate a string with a variable in SMARTY?

It is necessary to add slashes at the beginning and at the end when displaying the link ( catalog/{$cat->url} ).
To be something like this (php): var = '/'.catalog/{$cat->url}.'/'
Now the url is returned without the leading and trailing slash.

<a href="catalog/{$cat->url}" data-category="{$cat->id}">{$cat->name|escape}</a>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
lnroma, 2017-11-07
@lnroma

what's stopping you from writing like this?

<a href="/catalog/{$cat->url}/" data-category="{$cat->id}">{$cat->name|escape}</a>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question