LaravelBook\Laravel4Powerpack\Form::id PHP Method

id() protected method

Determine the ID attribute for a form element.
protected id ( string $name, array $attributes ) : mixed
$name string
$attributes array
return mixed
    protected function id($name, $attributes)
    {
        // If an ID has been explicitly specified in the attributes, we will
        // use that ID. Otherwise, we will look for an ID in the array of
        // label names so labels and their elements have the same ID.
        if (array_key_exists('id', $attributes)) {
            return $attributes['id'];
        }
        if (in_array($name, $this->labels)) {
            return $name;
        }
    }