Quantcast
Channel: CodeIgniter Forums - All Forums
Viewing all articles
Browse latest Browse all 14348

How to exchange user data with the same class instance

$
0
0
Hi Team,

I am using a controller which has several functions to process multiple steps in a user-process posting data to our server.

So we are building up a complete page by letting the user incrementally add information for each step.

I would like to store the information in public class variables. so they are available to all the functions when they render their respective views.

However, I cannot see a way to code the "action=" html form attribute so that I reenter the running instance of the controller (if indeed this is possble?). I have tried action="<?php $this->controller_function() ?>" and variants of this but this produces PHP FATAL error because it has no object context.

Currently, the code uses a URL similar to controller/function but this instantiates a new instance thereby losing the class variables previously set. $_SESSION is also used to keep values across instantiations.

I was really trying to tidy things up - so perhaps my question should be is there a better pattern for managing such a process?

Apologies if this isn't clear enough, there is a distinct possibility I have fundamentally not understood something :-(

regards, Paul

Viewing all articles
Browse latest Browse all 14348

Trending Articles