在 Opencart ( PHP MVC )

问题描述

我正在尝试获取所有级别的子类别,可能称为“递归”。像这样example。但我无法在这里应用它。我是 PHP 新手,被困在这里...

通过此功能,我只能获取所选类别的子类别(从用户获取)。 如何在此页面功能)上进行无限循环?这有可能吗?

public function addCategory() {
    $this->load->model('catalog/wk_rma_mapping');
    
    if($this->request->server['REQUEST_METHOD'] == 'POST') {
        
        foreach ($this->request->post['product_category'] as $category_id) {
            $sub_category   = $this->model_catalog_wk_rma_mapping->getSubcategory($category_id);
            var_dump($sub_category);
        }
    
    }
    
    
    
    
    $data['header'] = $this->load->controller('common/header');
    $data['column_left'] = $this->load->controller('common/column_left');
    $data['footer'] = $this->load->controller('common/footer');
    
    $this->response->setoutput($this->load->view('catalog/wk_rma_mapping_form_category',$data));
}

任何帮助将不胜感激谢谢

enter image description here

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)