Overview

Namespaces

  • Ecailles
    • DomClassName
      • Bem

Classes

  • Bem
  • Contexts
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated

Class Bem

Class Bem

Namespace: Ecailles\DomClassName\Bem
Package: Ecailles\DomClassName\Bem
Located at Bem/Bem.php
Methods summary
public
# __construct( string $prefix = null, string $prefixSeparator = null, string $elementSeparator = null, string $modifierSeparator = null )

Bem constructor.

Bem constructor.

Parameters

$prefix
The prefix.
$prefixSeparator
The prefix separator.
$elementSeparator
The Element separator.
$modifierSeparator
The Modifier separator.
public string
# __toString( )

Returns the string representation of the instance.

Returns the string representation of the instance.

Returns

string
The string representation.
public Ecailles\DomClassName\Bem\Bem|
# __call( string $name, mixed[] $arguments )

The magic method that is triggered when invoking an inaccessible method in an object context.

The magic method that is triggered when invoking an inaccessible method in an object context.

Parameters

$name
The name of the method being called.
$arguments
The arguments of the method being called.

Returns

Ecailles\DomClassName\Bem\Bem|

The current instance of Bem when the method name is class. A cloned instance of Bem when the method name is clone.

public Ecailles\DomClassName\Bem\Bem
# prefix( string $name )

Changes the prefix.

Changes the prefix.

Parameters

$name
The prefix to change.

Returns

Ecailles\DomClassName\Bem\Bem
The current instance of Bem.
public Ecailles\DomClassName\Bem\Bem
# prefixSeparator( string $separator )

Changes the prefix separator.

Changes the prefix separator.

Parameters

$separator
The prefix separator to change.

Returns

Ecailles\DomClassName\Bem\Bem
The current instance of Bem.
public Ecailles\DomClassName\Bem\Bem
# block( string|string[] $names )

Adds Block name(s).

Adds Block name(s).

Parameters

$names
The name(s) to add.

Returns

Ecailles\DomClassName\Bem\Bem
The current instance of Bem.
public Ecailles\DomClassName\Bem\Bem
# blockModifier( string|string[] $names )

Adds Block Modifier name(s).

Adds Block Modifier name(s).

Parameters

$names
The Block Modifier name(s) to add.

Returns

Ecailles\DomClassName\Bem\Bem
The current instance of Bem.
public Ecailles\DomClassName\Bem\Bem
# element( string|string[] $names )

Adds Element name(s).

Adds Element name(s).

Parameters

$names
The Element name(s) to add.

Returns

Ecailles\DomClassName\Bem\Bem
The current instance of Bem.
public Ecailles\DomClassName\Bem\Bem
# elementSeparator( string $separator )

Changes the Element separator.

Changes the Element separator.

Parameters

$separator
The Element separator to change.

Returns

Ecailles\DomClassName\Bem\Bem
The current instance of Bem.
public Ecailles\DomClassName\Bem\Bem
# elementModifier( string|string[] $names )

Adds Element Modifier name(s).

Adds Element Modifier name(s).

Parameters

$names
The Element Modifier name(s) to add.

Returns

Ecailles\DomClassName\Bem\Bem
The current instance of Bem.
public Ecailles\DomClassName\Bem\Bem
# modifier( string|string[] $names )

Adds contextual Modifier name(s).

Adds contextual Modifier name(s).

Parameters

$names
The contextual Modifier name(s) to add.

Returns

Ecailles\DomClassName\Bem\Bem
The current instance of Bem.
public Ecailles\DomClassName\Bem\Bem
# modifierSeparator( string $separator )

Changes the Modifier separator.

Changes the Modifier separator.

Parameters

$separator
The Modifier separator to change.

Returns

Ecailles\DomClassName\Bem\Bem
The current instance of Bem.
public Ecailles\DomClassName\Bem\Bem
# classname( string|string[] $classes )

Adds plain class name(s).

Adds plain class name(s).

Parameters

$classes
The class name(s) to add.

Returns

Ecailles\DomClassName\Bem\Bem
The current instance of Bem.
public string[]
# get( )

Builds and gets the class name(s) as an array.

Builds and gets the class name(s) as an array.

Returns

string[]
An array of the class name(s).
public string
# value( )

Builds and gets the class name(s) as a string.

Builds and gets the class name(s) as a string.

Returns

string
The class name(s) string.
protected boolean
# hasBlock( )

Returns whether Block name(s) has/have been added.

Returns whether Block name(s) has/have been added.

Returns

boolean
True if Block name(s) has/have been added, false otherwise.
protected string[]
# getBlockModifiers( )

Gets the Block Modifier name(s) that has/have been added.

Gets the Block Modifier name(s) that has/have been added.

Returns

string[]
The Block Modifier name(s).
protected boolean
# hasBlockModifier( )

Returns whether Block Modifier name(s) has/have been added.

Returns whether Block Modifier name(s) has/have been added.

Returns

boolean
True if Block Modifier name(s) has/have been added, false otherwise.
protected boolean
# hasElement( )

Returns whether Element name(s) has/have been added.

Returns whether Element name(s) has/have been added.

Returns

boolean
True if Element name(s) has/have been added, false otherwise.
protected string[]
# getElementModifiers( )

Gets the Block Modifier name(s) that has/have been added.

Gets the Block Modifier name(s) that has/have been added.

Returns

string[]
The Block Modifier name(s).
protected boolean
# hasElementModifier( )

Returns whether Element Modifier name(s) has/have been added.

Returns whether Element Modifier name(s) has/have been added.

Returns

boolean
True if Element Modifier name(s) has/have been added, false otherwise.
protected string[]
# getContextualModifiers( )

Gets the contextual Modifier name(s).

Gets the contextual Modifier name(s).

Returns

string[]
The contextual Modifier name(s).
protected boolean
# hasContextualModifier( )

Returns whether contextual Modifier name(s) has/have been added.

Returns whether contextual Modifier name(s) has/have been added.

Returns

boolean
True if contextual Modifier name(s) has/have been added, false otherwise.
protected
# mergeContextualModifiers( )

Merges contextual Modifier name(s) with Block/Element Modifier name(s) based on the current context.

Merges contextual Modifier name(s) with Block/Element Modifier name(s) based on the current context.

protected string[]
# createBlockSet( )

Creates a set of the Block name(s).

Creates a set of the Block name(s).

Returns

string[]
The created set of the Block name(s).
protected string[]
# createBlockModifierSet( )

Creates a set of the Block Modifier name(s).

Creates a set of the Block Modifier name(s).

Returns

string[]
The created set of the Block Modifier name(s).
protected string[]
# createElementSet( )

Creates a set of the Element name(s).

Creates a set of the Element name(s).

Returns

string[]
The created set of the Element name(s).
protected string[]
# createElementModifierSet( )

Creates a set of the Element Modifier name(s).

Creates a set of the Element Modifier name(s).

Returns

string[]
The created set of the Element Modifier name(s).
protected string[]
# createSets( )

Creates sets of the Block, Element, Modifier name(s) based on the state.

Creates sets of the Block, Element, Modifier name(s) based on the state.

Returns

string[]
The sets of the items.
protected array[]
# createCartesianProduct( array $sets = [] )

Creates Cartesian product with given sets of name(s).

Creates Cartesian product with given sets of name(s).

Parameters

$sets
The sets of the name(s).

Returns

array[]
The created Cartesian product.
Magic methods summary
public Ecailles\DomClassName\Bem\Bem
# class( )

`.

`.

Returns

Ecailles\DomClassName\Bem\Bem
public Ecailles\DomClassName\Bem\Bem
# clone( )

Clones the current instance of Bem.

Clones the current instance of Bem.

Returns

Ecailles\DomClassName\Bem\Bem
Properties summary
protected string $context

The current context.

The current context.

# Contexts::NORMAL
protected string|null $prefix

The prefix.

The prefix.

#
protected string $prefixSeparator

The prefix separator.

The prefix separator.

#
protected string[] $blocks

The Block names.

The Block names.

# []
protected string[] $elements

The Element names.

The Element names.

# []
protected string $elementSeparator

The Element separator.

The Element separator.

#
protected string[] $modifiers

The contexts and Modifier names.

The contexts and Modifier names.

# []
protected string $modifierSeparator

The Modifier separator.

The Modifier separator.

#
protected string $classes

The plain class names.

The plain class names.

# []
DomClassName API Documentation API documentation generated by ApiGen