Welcome Guest, Not a member yet? Register   Sign In
file upload question ~ model or controller
#1

[eluser]Met[/eluser]
hi there

Trying to get my head around CI in general, working with a form that has an upload function and inputs to describe the upload.

I have a model to handle the updating of the datase base with values from teh form (name/desc/upload date etc).

i'm a little confused where to put the upload class code.

Should it go in the controller, then call the model function to update the database, or can I put the upload code within the model ? Does it matter?

The user guide says to create a controller but this is a stand alone form.

thanks for any clarification.
#2

[eluser]Crimp[/eluser]
The beauty and horror of CI is that all the above will work. It only matters in the sense that what you are building makes sense and can be figured out, by you or someone else, later. Consistency is thus key.

I put the logic of handling the upload in the controller and pass any db operations to a model.




Theme © iAndrew 2016 - Forum software by © MyBB