我目前正在接受我對FuelPHP的第一次冒險,並想知道如何在模型中標記某些鍵(例如用戶名),以及是否可以使用油。特別是在模型驗證方面,如:FuelPHP中的唯一鍵/索引
protected static $_properties = array(
'id',
'name' => array(
'data_type' => 'string',
'label' => 'Name',
'validation' => array('required', 'max_length'=>array(100), 'min_length'=>array(10)) //validation rules
),
'username' => array(
'data_type' => 'string',
'label' => 'Username',
'validation' => array('required', 'unique') // does this work?
)
)