Welcome Guest, Not a member yet? Register   Sign In
why in my Model cant use $this->load->view() ??
#6

[eluser]yudahebat[/eluser]
my problem actually want to set_value on form signup

but because I use redirect on model it can display on the redirect page.

this is my view(only the form) :
Code:
$attributes = array('class' => 'cssform', 'id' => 'myform');
                    echo form_open('/mrputucar/create_member/', $attributes);
                    echo '<div id="error2">';
                    echo $this->session->flashdata('error_sign');
                    echo $this->session->flashdata('success_text');
                    echo '</div>';    
                    echo form_hidden('id','');
                    echo form_hidden('level','mbr');
                    echo '<p>';
                    echo form_label('Username', 'username');
                    echo form_input('username',set_value('username')); echo '&nbsp;*)';
                    echo '</p>';
                    echo '<p>';
                    echo form_label('Password', 'password');
                    echo form_input('password',set_value('password'));echo '&nbsp;*)';
                    echo '</p>';
echo '<div style="margin-left: 160px;">';
                        $data = array(
                        'id'   => 'submitbutton1',
                        'value'=> 'Create',
                        );
                        echo form_submit($data);
                        $data = array(
                        'id'   => 'submitbutton1',
                        'value'=> 'Reset',
                        );
                        echo form_reset($data);
                        echo '</div>';
                    
                    echo form_close();

this is my controller:
Code:
function signup()
    {
        $data['css']         = $this->css;
        $data['base']         = $this->base;
        $data['menu_web']     = $this->menu;
        $data['myrobots']     = '&lt;meta name="robots" content="noindex,nofollow"&gt;';
        $data['mywebtitle'] = 'mrputucar | Sign Up';
    
        $this->load->view('signup',$data);    
    }    

....

function create_member()
    {
        $data = $this->Crud->create_member();
        $this->load->view('crud', $data);    
    }

and my model :
Code:
(validation rules)
....
if ($this->validation->run() == false)
        {
        
            $flashdata = array('error' => true, 'error_sign' => $this->validation->error_string);
            $this->session->set_flashdata($flashdata);
        
            redirect('/mrputucar/signup/');    
} else { ...

do you have any idea to set_value if you see my code??


Messages In This Thread
why in my Model cant use $this->load->view() ?? - by El Forum - 08-15-2009, 03:09 AM
why in my Model cant use $this->load->view() ?? - by El Forum - 08-15-2009, 03:26 AM
why in my Model cant use $this->load->view() ?? - by El Forum - 08-15-2009, 03:27 AM
why in my Model cant use $this->load->view() ?? - by El Forum - 08-15-2009, 07:34 PM
why in my Model cant use $this->load->view() ?? - by El Forum - 08-15-2009, 09:46 PM
why in my Model cant use $this->load->view() ?? - by El Forum - 08-16-2009, 02:49 AM
why in my Model cant use $this->load->view() ?? - by El Forum - 08-16-2009, 07:20 AM
why in my Model cant use $this->load->view() ?? - by El Forum - 08-16-2009, 07:53 AM
why in my Model cant use $this->load->view() ?? - by El Forum - 08-16-2009, 12:45 PM



Theme © iAndrew 2016 - Forum software by © MyBB