you shouldnt have such a function in the app controller then
move it into a component or let the models handle it completly

with a component:
$this->Component->sendEmail()

you could also form a EmailableBehavior and call from any place in
your model
$this->sendEmail()
or from a controller
$this->Model->sendEmail()


On 7 Jul., 15:53, "Matheus Oliveira\"" <[email protected]> wrote:
> My sendEmail function uses Models...
>
> Thank you!
>
> On 6 jul, 17:28, Tilen Majerle <[email protected]> wrote:
>
>
>
>
>
>
>
> > make a your custom Lib, put class file into app/libs and import it to
> > AppController :)
> > --
> > Lep pozdrav, Tilen Majerlehttp://majerle.eu
>
> > 2011/7/6 Matheus Oliveira" <[email protected]>
>
> > > I have a function in my AppController called "sendEmail", and when I
> > > need send a email in any part of my app I call $this-
> > > >sendEmail($param1, $param2, ...).
>
> > > Now i need send email by Shell, how i can do this without duplicate
> > > the code?
>
> > > Import the AppController in the Shell or move the function code to a
> > > Task and import it in the AppController?
>
> > > What best way? If possible show a exemple. :-)
>
> > > --
> > > Our newest site for the community: CakePHP Video Tutorials
> > >http://tv.cakephp.org
> > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp
> > > others with their CakePHP related questions.
>
> > > To unsubscribe from this group, send email to
> > > [email protected] For more options, visit this group
> > > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to