Thursday, September 11, 2014

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

Inflector is going to have a hard time with Apply as it is not a noun. Inflector will only ever handle pluralizing nouns, and it is generally a good idea to make your models/objects nouns and not verbs. You already have some good suggestions on better noun based names.

-Mark

On Tuesday, 9 September 2014 03:34:15 UTC-4, MarkB 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.

No comments: