私は、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