Welcome Guest, Not a member yet? Register   Sign In
reload form after save

i'm a beginner, i have a problem:

i don't know the best way to reload a form after saving results (with preload data)

in moduls i have

function loadFormRecord(){
load data to fill form

in controller

function form(){
call module loadFormRecord()

code to generete form that i pass
to form viewer

now i need to save and display again the form

i will make a new save function in my controller
can i recall form() function into save?

would it be more correct to build my form in a new module function?

[eluser]Colin Williams[/eluser]
Looks like you haven't gotten very far. I would say go with your gut and see where and how far it takes you.

sorry but i can't really understand wich is the cleaner way to do this

from what i read here

it seem that it is not possible to pass data from controller to model

so if i have a model that load data i can't then pass them to an other model to create the form (populated with values)

[eluser]Colin Williams[/eluser]
Watching these http://ellislab.com/forums/viewthread/92009/ might help.

And you can pass data to any method in PHP with arguments. The only limitation with CI and models is that you can't pass arguments to the model constructor. This can be remedied by having an initialize() method in the model that must be called directly.

thanks thats helps me a lot!

Theme © iAndrew 2016 - Forum software by © MyBB