Friday, August 16, 2013

Re: Extend a core behavoir

thanks, I tried to use App:uses but I got a fatal error "Class 'TreeBehavior' not found in..." I had this following line:

App::uses('ModelBehavior', 'TreeBehavior', 'Model');

but anyway using App::import it works as it should.

thanks,
MN

________________________________________
Java & C# desktop developer
PHP web developer


On Thu, Aug 15, 2013 at 4:02 PM, Rodrigo Mourão <rodrigo@webjump.com.br> wrote:
I already didi this with tree behavior like Andre recommended.

models/behaviors/tree_plus.php
<?php
App::import('Behavior', 'Tree');
class TreePlusBehavior extends TreeBehavior {    

}

Em quarta-feira, 14 de agosto de 2013 11h36min29s UTC-3, André Luis escreveu:
With App::import()...

Them you can extend it:
class MyTreeBehavior extends TreeBehavior...

Em quarta-feira, 14 de agosto de 2013 10h05min03s UTC-3, Mohammad Naghavi escreveu:
Hi All,
I want to extend the core TreeBehavior without replacing it or copying it to my own behavior folder, I just want to extend it to add some additional functionalists which are based on tree behavior.
is there a way to do it?

regards,
Mohammad

--
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.

--
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: