Although I’m doing this in cakephp, i believe I have a terrible php-syntax-newbie-mistake in my code, but I can’t decipher the correct way.
The mistake is in the line:
'logo' => $validateArray
Apparently I have no clue on how to write that line, without repeating the above text.
var $validateArray = array(
'rule1' => array(
'rule' => 'isCompletedUpload',
'message' => 'File was not uploaded '
),
'written' => array(
'rule' => 'isSuccessfulWrite',
'message' => 'blah'
)
);
public $validate = array(
'logo' => $validateArray
);
The initialization of class property must be a constant value, can’t contain a variable.
You need to initialize it in the constructor instead.