The comment also apply to the method above.

----- Reply message -----
De : "Bernhard Schussek" <notifications@github.com>
Pour : "symfony/symfony" <symfony@noreply.github.com>
Cc : "Victor Berchet" <victor@suumit.com>
Objet : [symfony] [Form] Support buttons in forms (#6528)
Date : jeu., janv. 3, 2013 18:33
In src/Symfony/Component/Form/ButtonBuilder.php:
> +    public function hasAttribute($name)
> +    {
> +        return isset($this->attributes[$name]);
> +    }
> +
> +    /**
> +     * Returns the value of the given attribute.
> +     *
> +     * @param string $name    The attribute name.
> +     * @param mixed  $default The value returned if the attribute does not exist.
> +     *
> +     * @return mixed The attribute value.
> +     */
> +    public function getAttribute($name, $default = null)
> +    {
> +        return isset($this->attributes[$name]) ? $this->attributes[$name] : $default;

I think isset($val) ? $val : $default is common enough.


&mdash;

Reply to this email directly or view it on GitHub.