get_instance() in Codeigniter: Why assign it to a variable?

后端 未结 7 1709
清酒与你
清酒与你 2020-12-04 08:42

In Codeigniter, get_instance() is a globally available function that returns the Controller super-object which contains all the currently loaded classes (it ret

7条回答
  •  北荒
    北荒 (楼主)
    2020-12-04 09:09

    Method chaining is not supported in PHP4 and CI dropped support for PHP4 very recently (from version 2.0.0). Also it's easy to write $CI than writing get_instance() every time.

提交回复
热议问题