-2

post 変数をセグメント URL に渡すにはどうすればよいですか? URLから読み取ることはできますが、設定することはできません...これまでのところ:$route['shop/find/(:any)']= "shop/find/$1";ルート、ビューのfind.php、および関数`

function find()
    {
            $this->load->model('shopFront/find');
            $this->load->model('currency');
            $this->load->model('shopFront/calculate');
            $this->load->model('shop/proccess');
            $data = $this->commondatashop->general();
            $inputSlug = $this->input->post('findSlug');
            $data['tofind'] = $inputSlug;
            $data['cartInfo'] = $this->shopcart;
            $data['Currency'] = $this->currency;
            $data['Calculate'] = $this->calculate;
            $data['Proccess'] = $this->proccess;
            $data['title'] = "1.4.U Shop | Find";
            $finder = $this->find;
            $data['finderservice'] = $finder;
            $data['user_id'] = $this->session->userdata('user_id');
            $data['user_name'] = $this->session->userdata('user_name');
            $this->load->view('shop/top/topNew',$data);
            $this->load->view('shop/content/find',$data);

            //footer
            $curravailable = $this->calculate->getCurrencies();
            if ( $curravailable !== false )
            {
                $data['currencies'] = $curravailable;
            }
            else
            {
                $data['currencies'] = 'none';
            }
            $this->load->view('shop/footer',$data);


    }`

URLセグメントを使用してfind()関数に変数を投稿するにはどうすればよいですか?

4

2 に答える 2

0

あなたの見解では:

echo form_open('/shop/find');
echo form_input('findSlug','');
echo form_submit('submit', 'Submit');
echo form_close();

コントローラ:

$data[slug] = $this->input->post('findSlug');

フォームヘルパーもロードする必要があります

于 2013-07-12T03:28:32.220 に答える