虽然我在 cakephp 中这样做,但我相信我的代码中有一个可怕的 php-syntax-newbie-mistake,但我无法破译正确的方法。
错误在于:
'logo' => $validateArray
显然我不知道如何写那行,而不重复上面的文字。
var $validateArray = array(
'rule1' => array(
'rule' => 'isCompletedUpload',
'message' => 'File was not uploaded '
),
'written' => array(
'rule' => 'isSuccessfulWrite',
'message' => 'blah'
)
);
public $validate = array(
'logo' => $validateArray
);