CI が行うはずのように、URL から引数を取得する必要がある関数があります。しかし、それはしていません。私の URL は domain.com/lasers/en/acme です。
私のクラスのレーザーは次のとおりです。
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" です。では、なぜこれが機能しないのでしょうか。関数内の引数は正しい順序になっているため、何が問題なのかわかりません。