Wow I should really read the whole thead before responding... Glad
you got it working though.
As for performance, requestAction simulates another request to your
server, minus most of the bootstrapping and class loading.
-Mark
ps. apologies for the double post.
On Oct 9, 6:32 am, "Liebermann, Anja Carolin"
<[EMAIL PROTECTED]> wrote:
> Hi Siegfried, hi Martin,
>
> Now it works what I did:
> In my controller hotels_controller.php I have set (might not be necessary):
> var $uses = array('Hotel','Hotelinfo');
>
> And used the syntax
> $this->data = $this->Hotelinfo->add($hotelmaster_id,$this->Hotel->id);
>
> Which calls now in my model hotelinfo.php the function add
> function add($hotelmaster_id = null, $hotel_id = null) {
> //code
> $master = $this->Hotelinfomaster->getHotelinfomaster($hotelmaster_id);
> //modecode
>
> }
>
> And my model hotelinfomaster.php contains now
> function getHotelinfomaster($hotelmaster_id){
> //nice code
>
> }
>
> That does the job and now I am curious if it will help my performance.
>
> Thank you both for your help!
>
> Anja
>
> -----Ursprüngliche Nachricht-----
> Von: [email protected] [mailto:[EMAIL PROTECTED] Im Auftrag von
> Siegfried Hirsch
> Gesendet: Donnerstag, 9. Oktober 2008 12:24
> An: [email protected]
> Betreff: Re: Avoid requestAction
>
> > $this->data =
> > $this->Hotel->Hotelinfo->add($hotelmaster_id,$this->Hotel->id);
>
> calls the function add() in your model Hotelinfo - not in the controller.
> So as Martin has suggested, move the code for retriving or adding your
> information into the model and your should be done.
>
> On Thu, Oct 9, 2008 at 12:09 PM, Liebermann, Anja Carolin <[EMAIL PROTECTED]>
> wrote:
>
> > Hello Siegfried,
>
> > Now I try it this way:
> > In my controller hotels_controller.php I have set:
> > var $uses = array('Hotel','Hotelinfo');
>
> > And replaced
> > $this->data =
> > $this->Hotelinfo->requestAction('hotelinfomasters/getHotelinfomaster/'
> > .$hotelmaster_id);
> > By
> > $this->data =
> > $this->Hotel->Hotelinfo->add($hotelmaster_id,$this->Hotel->id);
>
> > Now I get an error:
> > $sql = "add"
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---