Skip to content

Classable

Mistralys edited this page Apr 29, 2021 · 1 revision

The classable trait and matching interface can be used to add HTML element class related methods like addClass(), addClasses() and the like.

Trait: Traits_Classable
Interface: Interface_Classable

Usage

use AppUtils;

class HTMLElement implements Interface_Classable
{
   use Traits_Classable;
}

Methods

  • addClass()
  • addClasses()
  • classesToAttribute() - Returns a string like class="foo bar"
  • classesToString() - Returns a string like foo bar
  • getClasses()
  • hasClass()
  • removeClass()

New here?

Have a look at the overview for a list of all helper classes available in the package.

Table of contents

Find the current page in the collapsible "Pages" list above, and expand the page, to view a table of contents.

Clone this wiki locally