[eluser]Jow272[/eluser]
Hello to you all,
I'm a bit stuck in the development of a site. I can't seem to get it working. Maybe one of you experts could lend me a hand?
What I want to do is this; I am building a site using CI (what else) in which at several instances adress data needs to be entered by the user. To preclude multiple instances of the same address in the address table I want to make sure that if the addres the user wants to add is already in the table, he or she will be noticed about the existance and if correct, can reuse the existing address.
This means that if the user enteres address data, the application needs to look this address up in the address table, if it finds an exact match it should automatically use the existing address or if it finds matching (but not exactly correct) addresses it should show a list of these matching addresses and give the user the option to choose the correct one. It is somewhat the same as when you search a person in LinkedIn or Twitter, you'll get a list of matching persons on a name.
Now, as this process will happen on more than one view, I would like to make a generel procedure for this whole process. I wanted to call it identify and place it in an address class.
Now my problem: I've writen the identify function and after first letting it find out if an exact match exists, I let it look in the table for matching addresses and now I want it to show these matching addresses in a list view.
If I call the identify function direct from URI everything works ok. The list is shown and I can select addresses and it gives feedback.
But if I call this function from an other function like a create function that is used to save the addres, It does not work. The list is not shown even though the complete code is processed (found that out debugging with echo's). The proces procedes through the identify function with finding matching addresses and past the row where the view is called and passes through even storing the address, but without showing the list page, it just ignores it!
I've been trying to find a solution all morning now, but with no luck. I want to call te view from within the identify function by simply using the $this->load->view($view, $data) code. I also tried to solve the problem with using redirect(), but the problem with this is that it does not allow to send data(like the list) with it. So that's not an option.
Can anyone guide me in the wright direction?
Thanx, (sorry for the long text)
Michel