Activecheckboxlist And Needs To Add Informations In The Value

Hello,

I have a activeCheckBoxList :




...

 echo $page->page_id.' <br />';

...

foreach ($dataProfil as $profil) {

        $profil->profil_id;

        echo '<div class="adroita">';

        echo CHtml::activeCheckBoxList($modelDroit, 'listDroits', $dataDroits,array('style'=>'width:25px'));

        echo '</div>';

    }



And I would like to add some information that I can use after submit,

for exemple I would like do someting like that:




<input style="width:25px" id="AdAdroita_listDroits_0" value="442dcb720bd940979062aa7a38f24ec9|4|12" type="checkbox" name="AdAdroita[listDroits][]"

value="442dcb720bd940979062aa7a38f24ec9|4|12

the first(442dcb720bd940979062aa7a38f24ec9) value is id of Droit

the second(4) value is id of page ($page->page_id)

the third (12)id is value of profil ($profil->profil_id)

any help ?

thank’s

Nath

edit: maybe I can do somethin with dataDroits




 $modelDroit = new AdAdroita();

    $listDroits = AdDroit::model()->findAll();

    $dataDroits = CHtml::listData($listDroits, 'droit_id', 'nom');



after spending hours, :blink: a solution, I don’t know if is a good one, but it’s works :




 $modelDroit = new AdAdroita();

    $modelDroit->fkProfil = $fkProfil;

    $listDroits = AdDroit::model()->findAll();

    foreach ($listDroits as $value) {

        $value->fkProfilFkPageFkDroit=$value->droit_id."|".$fkProfil."|".$page->page_id;

        //$listDroitsPlus[$value->nom]=$value->nom;

    }


 $dataDroits = CHtml::listData($listDroits, 'fkProfilFkPageFkDroit', 'nom');

...


 foreach ($dataProfil as $profil) {

        echo '<div class="adroita">';

        echo CHtml::activeCheckBoxList($modelDroit, 'listDroits', $dataDroits,array('style'=>'width:25px'));

        echo '</div>';

    }



and I had fkProfilFkPageFkDroit in my model AdDroit !

I lot time for someting easy at the end… ;D