Enregistre une legende.

@param string     $name   Clé unique.
@param string     $legend Texte à afficher.
@param array|null $attr   Liste d'attributs.

@return $this
340225
public function legend($name, $legend, array $attr = null)
    {
        return $this->input($name, [ 'type' => 'legend', 'legend' => $legend, 'attr' => $attr ]);
    }
705936
public Legend selected(String name, Boolean selected) {
        if (!this.data.contains(name)) {
            throw new RuntimeException("Legend中不包含name为" + name + "的图例");
        }
        if (this.selected == null) {
            this.selected = new LinkedHashMap<String, Boolean>();
        }
        this.selected.put(name, selected);
        return this;
    }
77277
public function addSubmit($name, $attr = [])
    {
        $e = new \FrenchFrogs\Form\Element\Submit($name, $attr);
        $e->setValue($name);
        $e->setOptionAsPrimary();
        $this->addAction($e);
        return $e;
    }
1256152
public function setAttribute($name, $value)
    {
        foreach ($this as $node) {
            if ($node instanceof \DOMElement) {
                /** @var \DOMElement $node */
                $node->setAttribute($name, $value);
            }
        }
        return $this;
    }
830873
public function setLegend($legend)
    {
        if (isset($this->fieldsets[$this->current])) {
            $this->fieldsets[$this->current]->setLegend($legend);
        }
        return $this;
    }
353308
public function setPlaceholder(string $name = null) : self
    {
        if (is_null($name)) {
            $this->field->removeAttribute('placeholder');
        } else {
            $this->field->addAttribute('placeholder', $name);
        }

        return $this;
    }
1093289
public function closure( $name, $content = null, $comment )
	{
		return $this->add( ( $comment ? static::make( 'comment', array( $comment ) )."\n" : '' ).
			$name."\n{\n".str_replace( "\n", "\n\t", "\t".CCStr::capture( $content ) )."\n}" );
	}
547987
public function addAttr($name, $value)
    {
        $name = trim($name);
        $value = trim($value);

        if ($value && !$this->existsAttr($name)) {
            $this->attrs[$name] = $value;
        }

        return $this;
    }
284210
public function setAttribute(string $name, string $value) : Label
    {
        $this->tag->setAttribute($name, $value);

        return $this;
    }
1093739
public function openTag($name, $attributes=null) {
        if ($attributes) {
          $initial = $name;
          $name = self::open($initial);
          $name .= self::getAttributesCollection($attributes);
          $name .= ">";

          return $name;
        } 

      return self::fullOpen($name);
    }
1244829
public function attr($name, $args = [])
    {
        $attr = $this->hasMapping($name) ? $this->getMapping($name) : $name;
        
        if (func_num_args() > 1) {
            return $this->prefix(vsprintf($attr, (array) $args));
        }
        
        return $this->prefix($attr);
    }
1321242
public function addNotificationAttr($attr) {
        if(!isset($this->_subscription->notification)){
            $this->_subscription->notification = (object) [];
        }

        if (!isset($this->_subscription->notification->attrs)) {
            $this->_subscription->notification->attrs = [];
        }
        array_push($this->_subscription->notification->attrs, $attr);
        return $this;
    }
891043
public function setAttribute($name, $value = null)
    {
        $name = strtolower($name);
        if (is_null($value)) {
            $value = $name;
        }
        if (in_array($name, $this->watchedAttributes)) {
            $this->onAttributeChange($name, $value);
        } else {
            $this->attributes[$name] = (string)$value;
        }
        return $this;
    }
1030619
public function addAttributes(array $attr)
    {
        foreach ($attr as $name => $value) {
            $this->setAttribute($name, $value);
        }

        return $this;
    }
1002769
public function setName($name) {
    if (is_string($name)) {
      $name = Token::identifier($name);
    }
    $this->name->replaceWith($name);
    return $this;
  }
1338473
public function setAttrAria(string $name, ?string $value): void
  {
    $this->attributes['aria-'.$name] = $value;
  }
921628
public function create($name, array $attr = [])
    {
        $model = $this->make($name, $attr, true);

        $this->store->persist($model);

        if ($this->triggerCallback($model, $name)) {
            $this->store->persist($model);
        }

        return $model;
    }