저는 CI와 같은 URL에서 인수를 가져와야하는 함수가 있습니다. 그러나 그것을하지는 않습니다. 내 URL은 domain.com/lasers/en/acme입니다.Codeigniter가 URL에서 인수를 취하지 않습니다.
내 클래스 레이저는 다음과 같습니다
class Lasers extends CI_Controller {
function __construct()
{
parent::__construct();
$this->load->model('products_model');
$this->load->model('common_model');
$this->load->model('select_country_model');
$this->load->model('markets_materials_model');
}
function index($lang = NULL, $laser = NULL)
{
$query = $this->products_model->get_product_content($laser, $lang);
}
모델은 생성자에서로드됩니다. 필요한 $ lang은 "en"이고 필요한 $ laser는 "acme"입니다. 그렇다면 왜 이것이 효과가 없습니까? 함수의 인수가 올바른 순서로되어있어 무엇이 잘못되었는지 알 수 없습니다.
을 대체 할 _remap를 사용할 수 있습니다 이걸 어떻게 접근하고 있니? 당신의 URL은 무엇입니까? – ace
또한'config/routes.php'에서 라우트 파일을 변경 했습니까? – ace