2017-09-02 52 views

回答

0

你可以使用PHP与回声,但最好的做法是使用像Twig这样的模板引擎,所以你可以将控制器与视图分开。 为此,我在wordpress中使用木材插件(https://fr.wordpress.org/plugins/timber-library/)。

你可以在我的插件看我如何使用它,在这里如何呈现树枝文件: https://github.com/meilleur-monde/wp-quotes-widget/blob/master/src/class-quotes-widget.php#L653

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