Re: Model without table
On Thu, Mar 12, 2009 at 3:21 AM, mscdex wrote: > > On Mar 12, 2:21 am, kaushik wrote: >> var $table = false; Also, make the c in contact uppercase:: class Contact extends AppModel --~--~-~--~~~---~--~~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Model without table
On Mar 12, 2:21 am, kaushik wrote: > var $table = false; As previously noted, it should be $useTable and not $table. --~--~-~--~~~---~--~~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Model without table
As per your direction, i have used this code in model: class contact extends AppModel { var $name = 'Contact'; var $table = false; } and this code in controller: class ContactsController extends AppController { var $name = 'Contacts'; var $components = array('RequestHandler'); var $helpers = array('Html', 'Form', 'Javascript', 'Validation'); //var $scaffold; function index() { if (!empty($this->data['Contact'])) { //code for mailing $msg = "Successful"; } } } Still it is giving this error: "Missing Database Table Error: Database table contacts for model Contact was not found." What is wrong in my code? On Mar 11, 11:05 pm, mscdex wrote: > On Mar 10, 7:32 am, Walther wrote: > > > Just add in your model: > > > var $table = false; > > Close, it's actually $useTable. --~--~-~--~~~---~--~~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Model without table
Bugger, I always get that one wrong, I obviously don't use it enough... On Mar 11, 8:05 pm, mscdex wrote: > On Mar 10, 7:32 am, Walther wrote: > > > Just add in your model: > > > var $table = false; > > Close, it's actually $useTable. --~--~-~--~~~---~--~~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Model without table
On Mar 10, 7:32 am, Walther wrote: > Just add in your model: > > var $table = false; > Close, it's actually $useTable. --~--~-~--~~~---~--~~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Model without table
Check out Jonathan Snook's article: http://snook.ca/archives/cakephp/contact_form_cakephp/ On Mar 10, 8:10 am, kaushik wrote: > I am going to develop a section in a site, where there is no database > operation. Only there will a form and a mail will fire on submit of > the very form. How to design model for this section? --~--~-~--~~~---~--~~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Model without table
Just add in your model: var $table = false; That will tell cake that there is no table associated with that model. On Mar 10, 10:10 am, kaushik wrote: > I am going to develop a section in a site, where there is no database > operation. Only there will a form and a mail will fire on submit of > the very form. How to design model for this section? --~--~-~--~~~---~--~~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: model without table: contact form (CAKE 1.2.0.54727alpha)
by the way, for those that need a contact form these are my views: --- views/contacts/index.ctp --- Contatti: create('Contact', array('url'=>'/contacts'));?> input('nome', array('error' => array( 'required' => 'specifica il tuo nome') ) ); echo $form->input('cognome', array('error' => array( 'required' => 'specifica il tuo cognome') ) ); echo $form->input('e-mail', array('error' => array( 'required' => 'specifica la tua e-mail', 'validEmail' => 'inserisci un e-mail valida' ) ) ); echo $form->input('oggetto', array('error' => array( 'required' => 'specifica l \'oggetto') ) ); echo $form->input('messaggio', array('error' => array('required' => 'inserisci il messaggio'), 'type'=>'textarea', 'cols'=>30)); ?> --- views/layouts/email/text/email.ctp --- --- EMAIL FROM YOUR WEBSITE NAME HERE --- FROM : E-MAIL : SUBJECT: --- MESSAGE: --- --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com 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 -~--~~~~--~~--~--~---