AttributeBehavior

 当事件触发的时候...

会循环所有behavior的events  为ower添加事件.....AttributeBehavior  为事件添加如下方法

	public function evaluateAttributes($event)
	{
		if (!empty($this->attributes[$event->name])) {
			$attributes = (array)$this->attributes[$event->name];
			$value = $this->getValue($event);
			foreach ($attributes as $attribute) {
				$this->owner->$attribute = $value;
			}
		}
	}

  

可以看到..循环所有特性...根据getValue获取所有特性...并设置owner的值...

原文地址:https://www.cnblogs.com/zhepama/p/3602928.html