Welcome Guest, Not a member yet? Register   Sign In
Set the value of "set_value" in controller
#1

[eluser]darytas[/eluser]
Hi,

first at all, I really enjoy CI.
I tried CakePHP and Zend, but they sucked compared to CI (bigger isnt alway better, right?).

So, I'm developing in a medium-sized company, currently on a project, related to mobile message service. Whatever, I stuck at the following problem:

(created some screenshots, but all of those are in german.)

- A user should enter some information (for a mobile message)
- http://i387.photobucket.com/albums/oo317...orm_01.png

- The user can submit (Absenden) or preview (Vorschau) the mobile message:
- http://i387.photobucket.com/albums/oo317...orm_02.png

So, my idea to create this form was the following:
- Submit the form and create an array
- Check if the preview button was clicked and decide with view to load

Code:
$smsdata = array ( 'senderid'   => $this->input->post('senderid'),
                   'recipients' => $this->input->post('recipients'),
                   'message'    => $this->input->post('message'),
                   '_date'      => $this->input->post('_date'),
                   '_hour'      => $this->input->post('_hour'),
                   '_minute'    => $this->input->post('_minute'),
                   'notify'     => $this->input->post('notify'),
                   'gateway'    => $this->input->post('gateway'));

            
           # preview or send sms
           if ($this->input->post(('preview'))) {

            # put data on view          
            $data['smsdata'] = $smsdata;
              
            # show preview
            $this->load->view('users/sms_preview', $data);
            
           } else {

            # send sms
            /* do real messsage sending here */

            # load sms sent view
            $this->load->view('users/sms_sent', $data);
            
           }


This stuff is working fine, but my problem is... how to get the values I got into the preview, back into the "editable form" if the user decides to edit the data currently available within the preview?

I hope my english is understandable! Wink

Thanks!

darytas


Messages In This Thread
Set the value of "set_value" in controller - by El Forum - 03-02-2009, 09:10 AM
Set the value of "set_value" in controller - by El Forum - 03-02-2009, 09:27 AM
Set the value of "set_value" in controller - by El Forum - 03-02-2009, 09:43 AM



Theme © iAndrew 2016 - Forum software by © MyBB