使用Codeigniter的相关下拉列表

时间:2016-12-09 20:18:28

标签: javascript php ajax codeigniter

这是我的模特:

Rx.Observable.range(num1, num2 - num1 + 1)
  .scan((result, val) => result * val, 1)
  .subscribe(v => console.log(v));

这是我的观点:

public function get_site_lang()
        {
            $query = $this->db->query("SELECT id_lang,name from LANGUAGE");
            return $query->result_array();
        }

        public function get_compo_list($language)
        {
            $query = $this->db->query("SELECT m.id_menu,name from lang_menu l JOIN MENU m ON l.menu_id=m.id_menu
                                       WHERE m.parent_id is NULL and l.lang_id=$language");
            return $query->result_array();
        }

        public function get_compo_cat_list($id,$language)
        {
            $query = $this->db->query("SELECT m.id_menu,name from lang_menu l JOIN MENU m ON l.menu_id=m.id_menu
                                           WHERE m.parent_id=$id and l.lang_id=$language");
            return $query->result_array();
        }

如何在&#34;选择一个孩子&#34; <div class="form-group"> <label>Select Language</label> <select class="form-control" name="language" required> <?php foreach ($lang as $l) { $selected = ($l['id_lang'] == $this->input->post('lang_id')) ? ' selected="selected"' : null; echo '<option value="'.$l['id_lang'].'" '.$selected.'>'.$l['name'].'</option>'; } ?> </select> </div> <div class="form-group"> <label>Select Parent</label> <select name="id_menu" class="form-control" id="id_menu"> <?php foreach ($compo as $co) { echo "<option value=".$co['id_menu'].">".$co['name']."</option>"; } ?> </select> </div> <div class="form-group"> <label>Select Child</label> <select class="form-control" name="type"> <option value="">Select A Child</option> </select> </div> 运行后我应该有哪些选项?在尝试使用(Ajax)和(JavaScript)之后,我忽略了这一点,但它无法正常工作。我在这里缺少什么?

0 个答案:

没有答案