Preferred method for using/writing template with PHP and HTML

In creating my own template, there seems to be two ways of displaying my body content using PHP and HTML. Which method tends to be the preferred, or **most correct**, method? **Is there an industry standard? For example - if I showed my code to Facebook, is there a certain method that the person hiring me would be looking for?** Both of them are clumsy at first to write. ***Method #1*** templateGetAboveContent(); //Begin unique content ?>

Example Header

***Method #2*** Example Header"; $body .= "
"; if ($row = mysql_fetch_assoc(mysql_query($get_article_sql)) { $body .= "
" . $row['article_content'] . "
"; } templateGetDisplayContent($body); ?> In **Method #2**, `templateGetDisplayContent()` would simply `echo $body;` where it should be, between the displayAbove and displayBelow code.
You should look into MVC and read the faq, especially the bit about the types of question to ask here,

以上就是Preferred method for using/writing template with PHP and HTML的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » HTML5 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准