How to add custom PHP classes for use within application
Permalink
I'm having a hard time finding any documentation on how to create my own classes for use throughout a Concrete5 site in 5.7. For example, I may want to reference this class in controllers, page type controllers, blocks, single pages, etc. In 5.6 I used to either create a Helper or a Model but since these are gone in 5.7 I'm not sure how to go about doing this. My first guess was to simply create my own directory in the application/ directory but I'm not sure this is correct. I'd like to know the right way to go about doing this. I did see some docs on creating my own packages, but it doesn't seem right to have to create a package to hold all my classes. Any insight would be greatly appreciated!
I believe you can use custom classes the same way in application/src as you would packages/src.
Example:
- application\src\Fruit.php
- in a controller
- in a view