开发Wordpress模板所需的编程语言是什么?

时间:2017-09-02 15:46:26

标签: wordpress

我想知道哪个是开发Wordpress模板的最佳编程语言?

1 个答案:

答案 0 :(得分:0)

您可以将php与echo结合使用,但最佳做法是使用像Twig这样的模板引擎,这样您就可以将控制器与视图分开。 为此,我在wordpress(https://fr.wordpress.org/plugins/timber-library/)中使用Timber插件。

你可以在我的插件中看到我如何使用它,这里是如何渲染twig文件: https://github.com/meilleur-monde/wp-quotes-widget/blob/master/src/class-quotes-widget.php#L653

这里是twig文件: https://github.com/meilleur-monde/wp-quotes-widget/blob/master/src/admin/templates/quotesWidgetForm.twig