# yii\behaviors

> 8 classes of the yii\behaviors namespace.

[API reference](/docs/api/index.md) › [yii](/docs/api/yii/index.md) › behaviors

## Classes

| Class | Summary |
| --- | --- |
| [`AttributeBehavior`](/docs/api/yii/behaviors/attributebehavior/index.md) | AttributeBehavior automatically assigns a specified value to one or multiple attributes of an ActiveRecord object when certain events happen. |
| [`AttributesBehavior`](/docs/api/yii/behaviors/attributesbehavior/index.md) | AttributesBehavior automatically assigns values specified to one or multiple attributes of an ActiveRecord object when certain events happen. |
| [`AttributeTypecastBehavior`](/docs/api/yii/behaviors/attributetypecastbehavior/index.md) | AttributeTypecastBehavior provides an ability of automatic model attribute typecasting. |
| [`BlameableBehavior`](/docs/api/yii/behaviors/blameablebehavior/index.md) | BlameableBehavior automatically fills the specified attributes with the current user ID. |
| [`CacheableWidgetBehavior`](/docs/api/yii/behaviors/cacheablewidgetbehavior/index.md) | Cacheable widget behavior automatically caches widget contents according to duration and dependencies specified. |
| [`OptimisticLockBehavior`](/docs/api/yii/behaviors/optimisticlockbehavior/index.md) | OptimisticLockBehavior automatically upgrades a model's lock version using the column name returned by [optimisticLock()](/docs/api/yii/db/baseactiverecord/index.md#method-optimisticLock). |
| [`SluggableBehavior`](/docs/api/yii/behaviors/sluggablebehavior/index.md) | SluggableBehavior automatically fills the specified attribute with a value that can be used a slug in a URL. |
| [`TimestampBehavior`](/docs/api/yii/behaviors/timestampbehavior/index.md) | TimestampBehavior automatically fills the specified attributes with the current timestamp. |