Tuesday, October 8, 2013

Re: App::build in CakePHP3

In 3.0, you'll be able to more easily override any of the classes that are resolved through App::classname(). This include helpers, behaviors, components, cache backends, loggers, and many other classes. By creating a matching classname in your application namespace, the App::classname() function will use the App\ classes first. For other classes like Hash you still cannot easily override the classes everywhere. You *can* however do the following.

namespace App\Utility;

use Cake\Utility\Hash as BaseHash;

class Hash extends BaseHash {
}

You can then use App\Utility\Hash throughout your code to get access to any additional methods you want to add/change.

-Mark

On Friday, 4 October 2013 03:04:53 UTC-4, h.kanji wrote:
Hi Everyone!

Now, I'm examining the CakePHP3. 
There is not App::build method in CakePHP3.

Of cource, I understand PSR-0. 

But, I need a way that can be extended without changing the existing functionality.
In CakePHP2 I can use class of their own instead of the classes the framework provides.

What can I do to do the same thing in CakePHP3?

--
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/groups/opt_out.

No comments: