src/Helpers/Html.php
public static function label($content, $for = null, $options = [], $encoding = null)
    {
        $options['for'] = $for;
        return static::tag('label', $content, $options, $encoding);
    }
public static function label($content, $for = null, $options = [], $encoding = null)
    {
        $options['for'] = $for;
        return static::tag('label', $content, $options, $encoding);
    }
Generates a label tag.
@param string $content label text. It will NOT be HTML-encoded. Therefore you can pass in HTML code
such as an image tag. If this is is coming from end users, you should [[encode()]]
it to prevent XSS attacks.
@param string $for the ID of the HTML element that this label is associated with.
If this is null, the "for" attribute will not be generated.
@param array  $options the tag options in terms of name-value pairs. These will be rendered as
the attributes of the resulting tag. The values will be HTML-encoded using [[encode()]].
If a value is null, the corresponding attribute will not be rendered.
See [[renderTagAttributes()]] for details on how attributes are being rendered.
@param string $encoding
@return string the generated label tag