IBehavior

优质
小牛编辑
126浏览
2023-12-01
所有包 | 方法
system.base
继承interface IBehavior
子类CActiveRecordBehavior, CBehavior, CModelBehavior, CTimestampBehavior
版本$Id: interfaces.php 3515 2011-12-28 12:29:24Z mdomba $
源码framework/base/interfaces.php
IBehavior是所有行为类必须实现的接口。

行为是一种可以增强组件的附加方法附加方法定义在行为类中, 而在组件类中没有。

公共方法

隐藏继承方法

方法描述定义在
attach()附加行为对象到组件。IBehavior
detach()从组件分离行为。IBehavior
getEnabled()返回是否启用行为IBehavior
setEnabled()设置行为是否被启用IBehavior

方法详细

attach() 方法
abstract public void attach(CComponent $component)
$componentCComponent要附加行为的组件。
源码: framework/base/interfaces.php#515 (显示) publicfunctionattach($component);

附加行为对象到组件。

detach() 方法
abstract public void detach(CComponent $component)
$componentCComponent要分离行为的组件。
源码: framework/base/interfaces.php#520 (显示) publicfunctiondetach($component);

从组件分离行为。

getEnabled() 方法
abstract public boolean getEnabled()
{return}boolean是否启用行为
源码: framework/base/interfaces.php#524 (显示) publicfunctiongetEnabled(); setEnabled() 方法
abstract public void setEnabled(boolean $value)
$valueboolean行为是否被启用
源码: framework/base/interfaces.php#528 (显示) publicfunctionsetEnabled($value);