Reputation: 1628
Example:
$Model->Behaviors->load('Some.Behaviour', $options);
// Now how do I get $options back from the model?
Is there a way to get $options
? $Model->actsAs
remains empty.
Upvotes: 0
Views: 101
Reputation: 34837
Those options are stored in the settings
property of the Behavior itself. You can get to it by using:
$this->Behaviors->Behavior->settings[''];
For example:
$this->Behaviors->load('Containable', array('hello' => 'world'));
var_dump($this->Behaviors->Containable->settings);
Would return:
array (size=2)
'priority' => int 10
'' =>
array (size=4)
'recursive' => boolean true
'notices' => boolean true
'autoFields' => boolean true
'hello' => string 'world' (length=5)
As you can see, the "hello world option" is right there at the bottom.
Upvotes: 1