Jump to content

variabile in tpl e js


ilario

Recommended Posts

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...