字符串在URL opencart链接上转换为Array

时间:2019-05-16 09:06:16

标签: php html opencart2.x

我在opencart的category.php中有一些代码可以与我的模块进行交互,我需要将一个数组作为字符串传递给URL,但是我丢失了一些东西,看来opencart具有不断转换字符串的功能再次排列...

这是我的代码

//MOD EOT - Adicionar os campos dos Filtros
if (isset($this->request->get['eot_filter'])) { 
    $eot_filters_url = $this->request->get['eot_filter'];               
    //$final_url = '';
    foreach ($eot_filters_url as $key=>$filter) {
        $final_url = '&eot_filter['.$key.'][Attr_id]='. $filter['Attr_id'];
        $final_url.= '&eot_filter['.$key.'][text]='.  $filter['text'];  

        $url .= $final_url;

    }
}
//MOD EOT END - Adicionar os campos dos Filtros

$pagination = new Pagination();
$pagination->total = $product_total;
$pagination->page = $page;
$pagination->limit = $limit;
$pagination->url = $this->url->link('product/category', 'path=' . $this->request->get['path'] . $url . '&page={page}');

$pagination->url放置&eot_filter=array而不是&eot_filter[0][Attr_id]=...

0 个答案:

没有答案