博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
AttributeBehavior
阅读量:4665 次
发布时间:2019-06-09

本文共 448 字,大约阅读时间需要 1 分钟。

 当事件触发的时候...

 

会循环所有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

你可能感兴趣的文章
分布式文件系统
查看>>
线程同步工具 Semaphore类的基础使用
查看>>
Bug的等级程度(Blocker, Critical, Major, Minor/Trivial)及修复优先级
查看>>
js多图预览及上传功能
查看>>
Mac下安装ionic和cordova,并生成iOS项目
查看>>
caffe介绍
查看>>
MongoDB副本集和分片模式安装
查看>>
Spring Mvc Url和参数名称忽略大小写
查看>>
Python之常用模块学习(一)
查看>>
CSS------如何让大小不一样的div顶部对齐
查看>>
SOCKET.IO 前后端使用
查看>>
CodeForces 122G Lucky Array(一脸懵逼的树状数组)
查看>>
【开发实例】C#调用SAPI实现语音合成的两种方法
查看>>
Django实战(15):Django实现RESTful web service
查看>>
离散实验二
查看>>
使用sharepoint里Open with explorer功能
查看>>
通过模糊来弱化背景
查看>>
The Fourth Day
查看>>
NSString 比较(转)
查看>>
[hdu3631]背包或中途相遇法
查看>>