correction ... $this->Model->Behaviors->Attachment->settings['Model']['basename'] = $filename;
On Sun, Apr 20, 2008 at 9:56 PM, b logica <[EMAIL PROTECTED]> wrote: > I just figured it out. > > $this->Model->Behaviors->Attachment->settings['Model']['dirname'] = > $upload_dir; > > $this->Model->Behaviors->Attachment->settings['Model']['transfer']['basename'] > = $filename; > > > > On Sun, Apr 20, 2008 at 9:24 PM, b logica <[EMAIL PROTECTED]> wrote: > > Cake 1.2, Attachments 4.2 > > > > I'm using the Attachment behavior and need to provide a different > > dirname based on the user. I'd like to append the new directory to the > > existing 'dirname' field set in the $actsAs array in the model. How > > can I do this from the controller just before save()? Modifying the > > model's array won't have any affect because the behavior will have > > already read it. Basically, it seems that I have to override these 2 > > lines in setup(): > > > > $dir = $this->replaceMarkers($this->settings[$model->alias]['dirname']); > > $this->settings[$model->alias]['dirname'] = $dir; > > > > The thing is, I can't figure out how to access the behavior from the > > controller. Is this possible? This is a bit of a show-stopper for me. > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
