脚本宝典收集整理的这篇文章主要介绍了php – 胡子部分和代码重用,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在使用PHP实现.我有,但是几个查询,因为我不习惯这个系统.
如何处理模板继承或重用?
我知道偏偏,但我应该如何使用它们?我在做这样的事情,包括:
top.mustache:
<!DOCTYPE htML> <html lang='es'> <head> <Meta charset=utf-8" /> <link rel="stylesheet" href="/media/style.css" type="text/css" media="screen" /> </head> <body> <header><h1><a href="/">Top</a></h1> </header> <section>
bottom.mustache:
</section> <footer><a href="http://potajecreativo.COM/">potaje</a></footer> </body> </html>
并且呈现此模板的视图:
{{>top}} <form action="/album/" method="post"> <p><label for="name">Name</label> <input type="text" name="name" value=""/></p> <p><label for="description">Description</label> <textarea name="description" rows="8" cols="40"></textarea></p> <p><input type="submIT" value="Save" /></p> </form> {{>bottom }}
这是正确的做法吗?
详见https://github.com/bobthecow/mustache.php/wiki/Template-Loading#partials-loading.
以上是脚本宝典为你收集整理的php – 胡子部分和代码重用全部内容,希望文章能够帮你解决php – 胡子部分和代码重用所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。