本文整理汇总了PHP中Field::validateSettings方法的典型用法代码示例。如果您正苦于以下问题:PHP Field::validateSettings方法的具体用法?PHP Field::validateSettings怎么用?PHP Field::validateSettings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Field
的用法示例。
在下文中一共展示了Field::validateSettings方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: validateSettings
public function validateSettings(MessageStack $messages, $checkForDuplicates = true)
{
if (!is_writable(DOCROOT . $this->{'destination'} . '/')) {
$messages->append('destination', __('Folder is not writable. Please check permissions.'));
}
return parent::validateSettings($messages, $checkForDuplicates);
}
示例2: validateSettings
public function validateSettings(MessageStack $messages, $checkForDuplicates = true)
{
if ($this->{'static-options'} == '' && ($this->{'dynamic-options'} == '' || $this->{'dynamic-options'} == 'none')) {
$messages->{'dynamic-options'} = __('At least one source must be specified, dynamic or static.');
}
return parent::validateSettings($messages, $checkForDuplicates);
}
示例3: validateSettings
public function validateSettings(MessageStack $errors, $checkForDuplicates = true)
{
/* if (trim((string)$this->{'text-length'}) == '') {
$errors->append('text-length', __('This is a required field.'));
}*/
if (trim((string) $this->{'column-length'}) == '') {
$errors->append('column-length', __('This is a required field.'));
}
return parent::validateSettings($errors, $checkForDuplicates);
}