开发者

How do I make a template function? [closed]

开发者 https://www.devze.com 2023-01-13 21:34 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly 开发者_如何转开发broad, or rhetorical andcannot be reasonably answered in its current for
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

精彩评论

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