Where to put plain object classes? |
(12-17-2014, 01:15 PM)sneakyimp Wrote:(12-02-2014, 06:48 AM)dmyers Wrote: Rufnex is correct, just as a side note thou: There is no an "official" way of doing that. The manual loader comes from PHP4 times and it stays as it is. You have two options for using framework-agnostic classes: 1. To make a custom autoloader. I proposed (and I recommend) it to be activated by using a hook, because it seems to me less "hackish" way. In my developments I modify the core files anyway for various reasons, this is why I include the autoloader at some point of bootstrapping. Yes, autoloading models is nice, because I can extend them without the need for include/require. See a sample rich implementation: https://github.com/ivantcholakov/starter...toload.php I prefer this option just to put my stuff and to use it without any bureaucracy. 2. The second option is Composer. I prefer it only for ready yet external components. During my work I don't want to write packages of my own (and to upload them to Packagist? - no way, no time for that). I just want to get the job done. |
Welcome Guest, Not a member yet? Register Sign In |