Welcome Guest, Not a member yet? Register   Sign In
How to structure my app?
#1

[eluser]Mauricio de Abreu Antunes[/eluser]
Hello,

I have a controller here:
My index() method shows my view and print my 'notes'.
Ok, i wanna do a insert page now.

The right way is create a insert() method that calls a view note_insert_view with my form?
And where do i put my validation and controll insertion method?

insert_note($params) in my controller?
#2

[eluser]Aken[/eluser]
Form validation in controller, database insert in a model.
#3

[eluser]Mauricio de Abreu Antunes[/eluser]
Ok, i know. But:
i have index() showing my 'notes' (notes_view.php)
and insert () showing my form to insert new notes (notes_insert_view.php)
i need to build insert_note method in my controller, no? with validation and using insertNote model method?
#4

[eluser]Mauricio de Abreu Antunes[/eluser]
Any idea?
#5

[eluser]Aken[/eluser]
No, just do it in insert(). Follow the example on the Form Validation user guide page.
#6

[eluser]Mauricio de Abreu Antunes[/eluser]
Thank you, dude! Smile




Theme © iAndrew 2016 - Forum software by © MyBB