Fong
Fong

Reputation: 115

Override a single method in a Cakephp Core Class?

I need to override cakephp's cakeEmail class's send method. I was working off of CakePhp: Cake Email AfterSend event

I can overwrite the entire class by using the cake cookbook method: "To override the Dispatcher class, create app/Lib/Routing/Dispatcher.php"

How do I overwrite a single method instead? Is this the most maintainable way to approach this? Thank you.

Cakephp 2.8.4

Upvotes: 0

Views: 618

Answers (1)

floriank
floriank

Reputation: 25698

How do I overwrite a single method instead? Is this the most maintainable way to approach this? Thank you.

Standard OOP:

Extend the class, overload method you want, use that class.

Upvotes: 3

Related Questions