Using PHP as a template engine

后端 未结 6 2194
梦毁少年i
梦毁少年i 2020-12-02 00:57

I am not going to argue about the choice of a template engine against only PHP. I choose not to use a template engine, like Smarty, because I would like to learn how to prop

6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-02 01:14

    Just use alternative PHP syntax for if/for/foreach control language constructs which are designed specifically for this purpose:

        

    Users

    0): ?>
    Id First Name Last Name
    Id); ?> FirstName); ?> LastName); ?>

    No users in the database.

    I also suggest creating view helpers for HTML outputs that are very similar and use them instead of having repeated HTML code.

提交回复
热议问题