Skip to content

feature request: optional attribute array values #1

Open
@rafaucau

Description

@rafaucau

It would be nice if something like this could be possible:

html_build_attributes(
  [
    'id' => 'post'
    'class' => [
      'post',
      'post--no-sidebar' => ! $has_sidebar,
      'post--no-thumb'   => ! $has_thumb,
    ],
  ] 
);

I mean, that it would be possible to set as an attribute value an associative array, where elements that are false, null, etc. are excluded.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions