Wednesday, July 23, 2014

Extending Core classes?

Is it currently possible to extend core classes in 3.0?
The namespace convention works with most files but how would I go about doing something like this.

I would like to modify a method in Cake\View\View
Here is what I have tried.

I have copied the cakephp/src/View/View.php file to my src/View/View.php file.
Changed the namespace to:
    namespace App\View;
Changed the class to:
    class View extends \Cake\View

This file does not seem to get called like the other Controllers, Helpers, Components etc...
Is it possible to override Files like these while leaving the core alone?
In 2.x you could do this with the Lib dir.


--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

No comments: