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?

有帮助吗?

解决方案 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.

其他提示

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top