Re: SQL? Why

2007-09-21 Thread Dr. Tarique Sani
On 9/21/07, AD7six <[EMAIL PROTECTED]> wrote: > > An apt solution would be to extend the component which you are using. > > > > Controller like functionality which needs to be used in several > > controllers === Component > > Indeed :)! > > And using a component with the same name as a model == co

Re: SQL? Why

2007-09-21 Thread AD7six
On Sep 21, 1:43 pm, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote: > On 9/21/07, deepc <[EMAIL PROTECTED]> wrote: > > > the idea was that any controller should be able to send emails with > > one line of code, and without the necessity of defining text or > > anything else. > > just the userid an

Re: SQL? Why

2007-09-21 Thread [EMAIL PROTECTED]
Sounds like you've got a problem with the naming of your models and components. If you are using the EmailComponent to send mails, you need to use $this->Email->send() in your controller. However, if your controller has a model called Email, then $this->Email will be the model instead of the compo

Re: SQL? Why

2007-09-21 Thread Dr. Tarique Sani
On 9/21/07, deepc <[EMAIL PROTECTED]> wrote: > the idea was that any controller should be able to send emails with > one line of code, and without the necessity of defining text or > anything else. > just the userid and a type of mail. the rest should be held in > database. An apt solution would

Re: SQL? Why

2007-09-21 Thread deepc
No, i just create the content in a central place. I use one of the bakery mail components. The situation is the following. I have template for a lot of emails in the database (table emails). in my emails controller i wanted to replace the variables with real life content and let the mail componen

Re: SQL? Why

2007-09-21 Thread Dr. Tarique Sani
On 9/21/07, deepc <[EMAIL PROTECTED]> wrote: > OK, i see. > if i move it to the model, is it still posible to access other models. > for example i have to get some data from my users table. > let me guess - you are getting the data which you want to send in the email in the send() method? I woul

Re: SQL? Why

2007-09-21 Thread deepc
OK, i see. if i move it to the model, is it still posible to access other models. for example i have to get some data from my users table. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to

Re: SQL? Why

2007-09-21 Thread Dr. Tarique Sani
On 9/21/07, deepc <[EMAIL PROTECTED]> wrote: > messages_controller > In my emails_controller is a function send() which should handle what If this is correct > $this->Email->send(); then this is wrong - the 'Email' here is the Model not the controller > i got: > Warning: SQL Error: 1064: You

SQL? Why

2007-09-21 Thread deepc
Hello, I have following models: Email Message and controllers emails_controller messages_controller In my emails_controller is a function send() which should handle what type of email should be send. If i call it from messags $this->Email->send(); i got: Warning: SQL Error: 1064: You have