1.更改所需的信息:
new sfValidatorString(
array(
'required' => true,
),
array(
'required'=>'You custom required message'
));
2.創建新的格式化程序類。
3.重新定義你想要的屬性。
<?php
class myWidgetFormSchemaFormatter extends sfWidgetFormSchemaFormatter
{
protected
$rowFormat = '',
$helpFormat = '%help%',
$errorRowFormat = '%errors%',
$errorListFormatInARow = " <ul class=\"error_list\">\n%errors% </ul>\n",
$errorRowFormatInARow = " <li>%error%</li>\n",
$namedErrorRowFormatInARow = " <li>%name%: %error%</li>\n",
$decoratorFormat = '',
$widgetSchema = null,
$translationCatalogue = null;
4.In的symfony形式的配置方法添加
$oDecorator = new myWidgetFormSchemaFormatter($this->getWidgetSchema());
$this->getWidgetSchema()->addFormFormatter('myCustom', $oDecorator);
$this->getWidgetSchema()->setFormFormatterName('myCustom');