本文整理匯總了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