ilario Posted November 26, 2022 Share Posted November 26, 2022 ciao avrei la necessità creare una nuova variabile in un file tpl e poi utilizzarla in un file js ho provato diverse cose ma non funziona mi potreste dare qualche suggerimento per favore Ilario Link to comment Share on other sites More sharing options...
idnovate.com Posted November 27, 2022 Share Posted November 27, 2022 In genere, si deve inviare la variabile al tpl: $this->context->smarty->assign(array( 'myVar' => 'value' )); Definirlo nella TPL: <s cript> var myVar = "{$value|escape:'html':'UTF-8'}"; </s cript> *Non è possibile utilizzare la parola "s c r i p t" scritta correttamente nel forum. E si può usare nel JS console.log(myVar); Link to comment Share on other sites More sharing options...
ilario Posted November 27, 2022 Author Share Posted November 27, 2022 grazie mille adesso lo provo 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