-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extending Core Classes #358
Comments
The Message class is a little bit of a different beast, honestly, since the Request and Response classes directly extend that class. If you're trying to add this method to the Response class, then you'd create a new class that extends
Then you'd modify the Service the system uses to use the new class instead of the existing one. The best way to do this is to copy the
And that's done. Now, when the system starts up, it should use your new class in place of the built-in one during all Response interactions throughout your application. No need to mess with the ClassMap directly in most cases, at least not when you have a namespaced class the autoloader can find. |
Oh - and next time, please use the forums to ask questions. This should be for bug reports only. |
Ahh, perfect! It works. This makes a lot more sense and is exactly what i needed to keep extending. Thank you! |
Coming from CI3 it was easier to edit functionality to the core. I have asked a buddy and have been messing with it myself but we can't seem to edit core classes without some hacky workarounds. According to the documentation it doesn't work as described? Maybe I am blind but this is what I have. I am trying to modify how this appends the code, but I can't get the function to override the original. Am I missing something?
The text was updated successfully, but these errors were encountered: