Back to OnGetApiAttributes class

Method addAttribute

public void
addAttribute
(mixed $name, mixed $value)
Set a named attribute to be rendered in the API.
Parameters
  • string $name The name of the property to be rendered in the api
  • mixed $value The value of the named property to be rendered in the api.
Returns
  • void
Since
  • 4.0.0

Method addAttribute - Source code

/**
 * Set a named attribute to be rendered in the API.
 *
 * @param   string  $name   The name of the property to be rendered in the api
 * @param   mixed   $value  The value of the named property to be rendered in the api.
 *
 * @return  void
 * @since   4.0.0
 */
public function addAttribute($name, $value) : void
{
    $this->attributes[$name] = $value;
}