src/Services/InputMaker.php
public function label($name, $attributes = [])
    {
        $attributeString = '';

        if (!isset($attributes['for'])) {
            $attributeString = 'for="'.$name.'"';
        }

        foreach ($attributes as $key => $value) {
            $attributeString .= $key.'="'.$value.'" ';
        }

        return '<label '.$attributeString.'>'.$name.'</label>';
    }
public function label($name, $attributes = [])
    {
        $attributeString = '';

        if (!isset($attributes['for'])) {
            $attributeString = 'for="'.$name.'"';
        }

        foreach ($attributes as $key => $value) {
            $attributeString .= $key.'="'.$value.'" ';
        }

        return '<label '.$attributeString.'>'.$name.'</label>';
    }
public function label ( $ name , $ attributes = [ ] ) { $ attributeString = '' ; if ( ! isset ( $ attributes [ 'for' ] ) ) { $ attributeString = 'for="' . $ name . '"' ; } foreach ( $ attributes as $ key => $ value ) { $ attributeString .= $ key . '="' . $ value . '" ' ; } return '<label ' . $ attributeString . '>' . $ name . '</label>' ; }
Create a label for an input.

@param string $name
@param array  $attributes

@return string
Create a label for an input .