PHP Class Spatie\GoogleTagManager\DataLayer

Afficher le fichier Open project: spatie/laravel-googletagmanager Class Usage Examples

Protected Properties

Свойство Type Description
$data array

Méthodes publiques

Méthode Description
__construct ( $data = [] )
clear ( ) Empty the data layer.
set ( array | string $key, mixed $value = null ) Add data to the data layer. Supports dot notation.
toArray ( ) : array Return an array representation of the data layer.
toJson ( ) : string Return a json representation of the data layer.

Method Details

__construct() public méthode

public __construct ( $data = [] )

clear() public méthode

Empty the data layer.
public clear ( )

set() public méthode

Inspired by laravel's config repository class.
public set ( array | string $key, mixed $value = null )
$key array | string
$value mixed

toArray() public méthode

Return an array representation of the data layer.
public toArray ( ) : array
Résultat array

toJson() public méthode

Return a json representation of the data layer.
public toJson ( ) : string
Résultat string

Property Details

$data protected_oe property

protected array $data
Résultat array