Sunday, March 28, 2010

Re: how to get model name into behavior

no, learning is sample, i have multi use of multiple models

On Mar 28, 12:17 pm, nurvzy <nur...@gmail.com> wrote:
> $Model->Learning->name;
>
> Hope that helps,
> Nick
>
> On Mar 27, 11:59 pm, Saleh Souzanchi <saleh.souzan...@gmail.com>
> wrote:
>
> > hi pleas help me to find model name :
>
> > class Learning extends AppModel{
>
> >   var $name = 'Learning';
> >   var $belongsTo = array(
> >      'Cat'    => array(
> >           'className'  => 'Cat',
> >           'counterCache' =>'entry_count',
> >      )
> >   );
>
> > }
>
> > ************************************************
>
> > class Cat extends AppModel{
> >   var $name = 'Cat';
> >   var $actsAs = array(  'MyTree'   ) ;
>
> > }
>
> > ************************************************
> > class MyTreeBehavior extends ModelBehavior {
>
> >  function setup(&$Model, $config = array()) {
>
> >    ===> how to get  name of model parent Cat
> > (Learning) ?????????????
>
> >   }
>
> > }

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

To unsubscribe from this group, send email to cake-php+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.

No comments: