本文整理汇总了PHP中sfWidgetFormSchemaFormatter::generateLabelName方法的典型用法代码示例。如果您正苦于以下问题:PHP sfWidgetFormSchemaFormatter::generateLabelName方法的具体用法?PHP sfWidgetFormSchemaFormatter::generateLabelName怎么用?PHP sfWidgetFormSchemaFormatter::generateLabelName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sfWidgetFormSchemaFormatter
的用法示例。
在下文中一共展示了sfWidgetFormSchemaFormatter::generateLabelName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generateLabelName
public function generateLabelName($name)
{
$labelName = parent::generateLabelName($name);
if (isset($this->validatorSchema[$name]) && $this->validatorSchema[$name]->getOption('required')) {
$labelName .= '<sup class="required">*</sup>';
}
return $labelName;
}
示例2: generateLabelName
public function generateLabelName($name)
{
$this->name = $name;
$label = parent::generateLabelName($name);
$validatorSchema = $this->form->getValidatorSchema();
if (isset($validatorSchema[$name]) && $validatorSchema[$name]->getOption('required')) {
$label .= ' <span class="form-required" title="This field is required.">*</span>';
}
return $label;
}
示例3: generateLabelName
/**
* Generates a label for the given field name.
*
* @param string $name The field name
* @param array $attributes Optional html attributes for the label tag
*
* @return string The label tag
*/
public function generateLabelName($name)
{
$isRequired = false;
if ($this->validatorSchema and isset($this->validatorSchema[$name])) {
$validator = $this->validatorSchema[$name];
if ($validator->getOption('required')) {
$class_name = $this->getParameter('required_label_class_name', 'required');
$isRequired = true;
}
}
$s = parent::generateLabelName($name);
$s = str_replace('%label%', $s, $this->labelFormat);
if ($isRequired) {
$format = $this->getParameter('required_label_format', $this->requiredLabelFormat);
$s = str_replace('%label%', $s, $format);
}
return $s;
}
示例4: generateLabelName
public function generateLabelName($name)
{
$this->lastWidgetName = $name;
return parent::generateLabelName($name);
}
示例5: generateLabelName
/**
* If field is required append the required format to the label name
*
* @see parent
*/
public function generateLabelName($name)
{
$label = parent::generateLabelName($name);
$validatorSchema = $this->getForm() ? $this->getForm()->getValidatorSchema() : null;
if (!$this->getMarkRequired() || !$validatorSchema || !isset($validatorSchema[$name])) {
return $label;
}
if ($validatorSchema[$name]->hasOption('required') && $validatorSchema[$name]->getOption('required') && !$validatorSchema[$name] instanceof sfValidatorSchema) {
$label .= $this->requiredFormat;
}
return $label;
}
开发者ID:kevindew,项目名称:sfJqueryValidationPlugin,代码行数:17,代码来源:sfWidgetFormSchemaFormatterJqueryValidation.class.php