-2
如何将帖子变量传递给网址?我可以从网址读取它,但我不能把它... 我有什么至今:$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);
}`
我怎样才能发布变量的find()函数与网址段?
是的但我后发现找到函数r edirects到查找查看器和网址保持mysite /找到而不是mysite/find /项目 –
如果你发布到'yoursite/controller/find',你不会得到那个变量,你需要发布到'yourside/controller/find/id'或发送POST数据,而不是从params收集,你可以使用CI的输入类。即$ i ='$ this-> input-> post('post_var_name');' – bizzehdee
所以我需要改变这个 <?php echo form_open('shop/find','find'); ?> <?php echo form_close(); ?> 用$ this-> input-> post代替提交? –