Docs: Attach behavior

In Component Behaviour @ http://www.yiiframework.com/doc/guide/basics.component it says:




// $name uniquely identifies the behavior in the component

$behavior->attach($name,$component);

// test() is a method of $behavior

$component->test();



but $behavior->attach($name, $component) is public void attach(CComponent $owner)

Even so, I can’t make that work, but then $component->attachBehavior(‘some_name’, new SomeClass) makes a lot more sense to me and it works :wink:

Thanks. Fixed in svn. It should be $component->attachBehavior($name,$behavior);