Dropdown list with dyanmic optgroup

前端 未结 3 1036
抹茶落季
抹茶落季 2021-01-03 10:32

Hi there cakephp experts! I am looking for you help on a dyanmic dropdown list with dyanamic optgroup. Suppose I have two tables:

 countries:  id, country_na         


        
3条回答
  •  孤城傲影
    2021-01-03 11:00

    bind tableB to tableA in tableA model, do

    $hasMany = array("tableB"=>array("className"=>"tableB","foreignKey"=>"aId"));
    

    then use

    find("all")
    

    might need

    $this->tableA->recursive->2
    

    right before find

提交回复
热议问题