Tuesday, September 9, 2014

Re: Naming Conventions... Apply. Applys. Applies? Gobsmacked!

Extending what Thomas said, you can also run any model off any database table. 

CakePHP has its conventions for table naming but if you need to you  can set the $useTable variable to use a custom table name.



On 9 Sep 2014, at 09:24, Thomas von Hassel <darxmac@gmail.com> wrote:

I would maybe call the model `Application` or `Registration` .. makes a bit more sense logically

The error you are seeing is because CakePHP pluralises names corretly, its doesn’t just put and `s` at the end


/thomas

On 09 Sep 2014, at 09:34, MarkB <markbarton68@gmail.com> wrote:

Hi,

This is not a support request, more of a WTF?

I'm ultra new to CakePHP and I just built my first app yesterday, loosely based on the Blog Tutorial. 

It is centred around the processing and management of proposal application forms for lectures at a conference, so I called my model 'Apply'. I followed naming conventions and so set up my ApplysController and Applys view folder etc etc etc.

I naturally called my database table 'applys', but when I run my app at www.example.com/applys it threw up an error message saying it couldn't find the database 'applies'.

Er... wow! How did it know? Annoying, but impressive.

Regards,
MarkB.

PS: I think it took me less time to build my app than hand code the 20 field HTML form for the application. I was expecting to be spending the rest of the week writing the code to validate it, process it and write to database securely (something I'm not too confident about!).  As a cut'n'paste programming web designer with fumbling knowledge of PHP and complete cluelessness regarding OOP, I wish I had looked at using a framework years ago. I think CakePHP is going to open up a whole new world to me.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

....................................
Mike Karthäuser
Director, Brightstorm Ltd.

1, Brewery Court
North Street
Bristol
BS3 1JS

mikek@brightstorm.co.uk
www.brightstorm.co.uk
+44(0) 7939252144
....................................

No comments: