开发者

How do I make a template function? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly 开发者_如何转开发broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 12 years ago.
//TEMPLATE FILE
<html>
f_blog_title();
</html>
//TEMPLATE LOAD
<?php
ob_start();
echo file_get_contents('TEMPLATE FILE');
ob_end_flush();
?>

Now my problem is, how to search f_???() and run ??? function?


If you're trying to build your own templating system, maybe you should look at existing ones and learn from the way they do it; Smarty seems most accessible for a beginner.


Smarty sucks - it does not force you to keep logic out of output and you'll be finaly creating code with compromises.

Try some fully XMLized as http://phptal.org/ it's actualy my choice to be honest. It's very clean and very easy to use. And the most important thing - it force you to keep logic in Your PHP code outside of templates.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜