在 model 中加入:
// 指定该 ActiveRecord 要使用的行为插件
'behaviors' => 'uniqueness',
// 指定行为插件的配置
'behaviors_settings' => array
(
# '插件名' => array('选项' => 设置),
'uniqueness' => array(
'check_props' => 'tag',
'error_messages' => array('tag' => '该目录下已经有内容,请选择其它目录录入')
)
),

