Pass Data In Between Two Models

how is it possible to pass data in between two models.

i have model called Search and Activity.

after a logic happen in Search i need a value to be stored in a session and after words when i access the session via Activity model i should get that stored value in session.

i added it the below way (creating session) Search Model

Yii::app()->session[‘ActivitiesId’] = $matchingActs;

used it in Activity as following…

print_r(Yii::app()->session[‘ActivitiesId’]); exit();

this doesnt work and i am thinking weather i should use getState and setState.

confused with two models data passing

OUTPUT is as below…


Array ( [0] => 2 [1] => 9 [2] => 3 [3] => 16 [4] => 8 [5] => 5 [6] => 4 [7] => 11 [8] => 1 [9] => 10 [10] => 13 [11] => 15 [12] => 14 [13] => 7 [14] => 17 [15] => 18 [16] => 12 [17] => 6 [18] => 19 [19] => 24 [20] => 25 )

but actually i insert only this array and i need it to be printed… but something else as above only comes up.


Array ( [0] => 24 [1] => 25 )  // $matchingActs

[size="4"]how can i pass data via a session in between Activity and Session Models ?..[/size]