开发者

can we write php tag libararies just like in java's tld [closed]

开发者 https://www.devze.com 2022-12-07 23:43 出处:网络
开发者_JAVA技巧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 form.
开发者_JAVA技巧 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 10 years ago.

can we write php tag libararies just like in java's tld?


No; PHP is a scripting language that gets interpreted between <?php (and <?= if short tags are enabled) and ?> tags. Any other tag is something different than PHP.

What you can do is use template engines like Smarty or TBS, which let you use other tags to separate PHP logic from presentation, but that's as far as you can go.


I do not recommend using PHP to parse other 'pseudo' code files, because this will end up in huge performance leaks.

Template engines are not the first choice, because PHP IS ALREADY a scripting language which allows templates, as said above: Use (short) tags within your HTML files and add them at the end of your process.

For more information about that topic look at MVC patterns ;)

0

精彩评论

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