Search code examples
phpcodeigniterinclude

Include files in Codeigniter


Where is the "best practice" place to put include files (inc.php) when using the Codeigniter framework?


Solution

  • Since you are asking for "best practice", let me give you a long answer:

    It's depend what is your included file is about. Since you are using a framework, CodeIginter have defined various places for you to place your library, helper, config, template, etc. It's better to stick to what the framework offers or you won't benefit from it.
    It's all about the maintainability, the structure of your app, etc. Don't use a framework unless you are intend to understand them. Use library instead if you are only looking to reuse functionality that people have written.