Domanda

How do you turn a piece of {{string}} into a php code, for instance,

{{secure_base_url}}

to

echo secure_base_url;

I see this kind of method is used a lot in Magento. I wonder how do you do it if you are writing your own programme. Do I need some kind of plugin to turn that kind of {{string}}s to codes?

È stato utile?

Soluzione 2

That is the templating variables Magento uses in email templates, invoices, etc. You can assign variables to Magento that you can later retieve in an email by using the double curly brackets syntax.

Custom variables in Magento

Magento - how to add custom variables to new order E-mail?

The same style of syntax is used in Twigg, smarty, and many other templating engines.

Altri suggerimenti

You write a parser to recognize the codes and transform them into actions.

But asking how to write a parser is way beyond the scope of stackoverflow.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top