I would be very interested in responses to this, especially the validation areas so please keep the discussion on-list if possible.
Thanks Grant -----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Monday, October 23, 2006 12:28 PM To: Cake PHP Subject: new to cake, and mvc in general Greetings, After putting work in for the past few months on a system I was going to build on phpBB3 (when it was released) I've decided to move over to a framework. Most of the work I've done is portable, as I was building around phpBB3, instead of modding it, with it being in development still. I did a lot of research, and it came down to 3 frameworks to try. Django, Code Igniter, and Cake. I went with Cake first. I didn't want to learn python, as it would basically invalidate most of the code I wrote already. Between Cake and Code Igniter, Cake appears to be the more robust of the two. I've had no problems with installation, even with using Xampp on my windows xp box for development. However here's some things I'm looking at, that I haven't found immediate answers for in the documentation. Data Validation - It's way too simple for what I want. I'm looking for ways to say, validate a date field is a real date, and then also validate that it's in an acceptable range (ie: over 14 years old). I'd also like to be able to set custom error messages based on error. Now, it looks like i can do a lot of this if i move more validation into the controller. I can then feed error messages using this->set('errorMsg', 'whatever'); and then display errorMsg in my view's return for an invalidate. However, as I understand it, i should be doing validation at the model level? I did try some of the snippets out there for overriding invalidate in app_model.php. I mainly just encountered preg-match errors all over the place and they didn't work. Database Access - Right now I'm just building a simple registration form for users. I noticed with sql debugging turned on that on the initial page view, before any of the data is submitted, a sql query is made to describe the table (DESC `users`). It appears that every page view using the model/controller/view setup does this query? This looks to me like unnecessary sql queries. Is there a way to set it so it only queries when it actually needs to interact with the database? Views - The tutorials I've found have dealt with pages that interact with the database for one thing. Like a blog. However, some of my pages are going to need to interact with different tables to display all types of information. My index page for example would show site announcements, new members, advertisements, maybe even latest forums posts, etc etc. Users will have a home page that once again would be a consolidation of various queries of unrelated information. Are there any tutorials for accomplishing this kind of thing? As I said, I'm entirely new to the MVC way of thinking. So far though, I'm generally impressed and believe I should definetly be able to speed up the process of development with Cake, now that I'm getting my head wrapped around it. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~----------~----~----~----~------~----~------~--~---
