获取车把模板的渲染值并将其放入PHP变量

时间:2018-05-26 11:04:16

标签: javascript php sql wordpress handlebars.js

<script type="text/template" id="ae-profile-loop">

<?php
//This helper snippet takes the JS variables and stores them into the current PHP context
$current_post_ID = "{{= ID }}";
$current_author_ID = "{{= post_author }}";...

上下文:这是位于服务器上的模板.php文件(用于handlebars.js)。我试图让$ current_author_ID成为{{= post_author}}呈现的值,而不是文字字符串&#34; {{= post_author}}&#34;本身。

该值是执行SQL查询所必需的,但它当前不会像我尝试传入$ current_author_ID那样工作,它使用文字字符串而不是它呈现的值。

欢迎将渲染值传递给php文件的任何其他解决方案。

0 个答案:

没有答案