CodeIgniter or PHP Equivalent of Rails Partials and Templates

后端 未结 11 1800
猫巷女王i
猫巷女王i 2020-12-30 14:13

In CodeIgniter, or core PHP; is there an equivalent of Rails\'s view partials and templates?

A partial would let me render another view fragment inside my view. I co

11条回答
  •  失恋的感觉
    2020-12-30 14:59

    This is unfortunately not CodeIgniter specific at all, however I suggest you to have a look at Savant3 template system. It allows you to render the template to a string. Then you can simply stuck it to wherever you wish.

    Maybe there's something like that in CodeIgniter?

    I can think of a way to add a facility when rendering the view, to render the template, and then all the sub-template it contains.

提交回复
热议问题