PHP在Django模板中不起作用 [英] PHP not working in django template
问题描述
代码为:
<!DOCTYPE html>
<html>
<body>
aaa
<?php
echo "hello";
?>
</body>
</html>
我在/Library/WebServer/Documents/test.php
下的 test.php
文件中进行了尝试它可以在 http://localhost/test.php
上使用.
I tried it within the test.php
file under /Library/WebServer/Documents/test.php
and it works at http://localhost/test.php
.
当我将其放入 project/app/template/app/index.php
中的 index.php
文件中时只有"aaa"显示在 localhost/app/
上,PHP无法正常工作.
When I put it in the index.php
file within the project/app/template/app/index.php
Only the "aaa" shows up at localhost/app/
and the PHP is not working.
有什么想法吗?
推荐答案
我还没有找到实现django中非重复的页眉和页脚功能的方法.它是通过模板继承来实现的.
I have not find some way to realize the non-repeating header and footer functionality in django. It is realized by template inheritance.
请指出这样做是否正确.
Please point out if this is not the right way to do so.
这篇关于PHP在Django模板中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!