How much code should be in a CodeIgniter view?

后端 未结 7 1869
长发绾君心
长发绾君心 2020-12-29 13:44

First steps are done, some pages are coded. And after looking to the result I\'ve got the question... how much code is there should be in templates (View)?

For examp

7条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-29 14:28

    I don't think what you're trying to achieve in the view is too much logic, but I think it should be cleaned up somewhat.

    Something like:

    
    

    I find that a lot easier to read, and it does the same job. I also don't think it would be hard for a non-coder to modify, which is ultimately the goal of a view.

提交回复
热议问题