Hi all, I´m starting with Cake and want to bring to it the classes I have used until now for creating applications.
Are there a group of classes for creating and validating web forms. In the "model" part of the code, I create a object "Form" that have many "FormElements", that can be "Input", "Select", and others objects relatives to its html tag equivalent. A "FormElement" has advanced validation rules, label, error message, tip message, etc. It´s all defined in the "model" side. Than, in the "View" side, I just call the method "buildForm()" from "Form" object, and It returns to me the complete form html code, with all the Javascript needed for client side validation. Than, back in the "Model" side, again I use the "Form" object, with the "load()" method. It gets the $_POST variable and load the "Form" object with values sent by the user. Now I call the method "validate()" of the "Form" object, and It do the server side validation, using the rules defined for each FormElement, the same used for creating the client side Javascript validation. It´s the way I´m working until Cake. Now I want to port it, becouse me and may employers are used to this way. But studing Cake for few days, I cannot realize the best way to do that. It´s a piece of code that has Model and View logic. What would be the best approach? Component + Helper ? Extending AppModel ? Using "vendor()" ? Plug-in? I already has a "Helper" created. It´s do the client side validation, but the validation logic need to be writen inside the view, and It´s not possible to do the server side validation. Any help is welcome! If I can realize this, all the work will be avaliable to the comunity. Sorry for the bad english. Hugs[] Gustavo Gonçalves www.fundacaoaprender.org.br --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
