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

[eluser]Mauricio de Abreu Antunes[/eluser]

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?

Form validation in controller, database insert in a model.

[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?

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

No, just do it in insert(). Follow the example on the Form Validation user guide page.

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

Theme © iAndrew 2016 - Forum software by © MyBB