PHP Класс Inpsyde\MultilingualPress\Asset\DebugAwareScript

С версии: 3.0.0
Наследование: implements Inpsyde\MultilingualPress\Asset\Script
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( string $handle, string $url, array $dependencies = [], string | null $version = '' ) Constructor. Sets up the properties.
__toString ( ) : string Returns the handle.
add_data ( string $object_name, array $data ) : static Makes the given data available for the script.
clear_data ( ) : static Clears the data so it won't be output another time.
data ( ) : array[] Returns all data to be made available for the script.
dependencies ( ) : string[] Returns the dependencies.
from_location ( string $handle, AssetLocation $location, array $dependencies = [], string | null $version = '' ) : static Returns a new script object, instantiated according to the given arguments.
handle ( ) : string Returns the handle.
url ( ) : string Returns the file URL.
version ( ) : string | null Returns the file version.

Описание методов

__construct() публичный метод

Constructor. Sets up the properties.
С версии: 3.0.0
public __construct ( string $handle, string $url, array $dependencies = [], string | null $version = '' )
$handle string The handle.
$url string The public URL for the directory containing the file.
$dependencies array Optional. The dependencies. Defaults to empty array.
$version string | null Optional. Version of the file. Defaults to empty string.

__toString() публичный метод

Returns the handle.
С версии: 3.0.0
public __toString ( ) : string
Результат string The handle.

add_data() публичный метод

Makes the given data available for the script.
С версии: 3.0.0
public add_data ( string $object_name, array $data ) : static
$object_name string The name of the JavaScript variable holding the data.
$data array The data to be made available for the script.
Результат static Script instance.

clear_data() публичный метод

Clears the data so it won't be output another time.
С версии: 3.0.0
public clear_data ( ) : static
Результат static Script instance.

data() публичный метод

Returns all data to be made available for the script.
С версии: 3.0.0
public data ( ) : array[]
Результат array[] Data to be made available for the script.

dependencies() публичный метод

Returns the dependencies.
С версии: 3.0.0
public dependencies ( ) : string[]
Результат string[] The dependencies.

from_location() публичный статический метод

Returns a new script object, instantiated according to the given arguments.
С версии: 3.0.0
public static from_location ( string $handle, AssetLocation $location, array $dependencies = [], string | null $version = '' ) : static
$handle string The handle.
$location AssetLocation Location object.
$dependencies array Optional. The dependencies. Defaults to empty array.
$version string | null Optional. Version of the file. Defaults to empty string.
Результат static Script object.

handle() публичный метод

Returns the handle.
С версии: 3.0.0
public handle ( ) : string
Результат string The handle.

url() публичный метод

Returns the file URL.
С версии: 3.0.0
public url ( ) : string
Результат string The file URL.

version() публичный метод

Returns the file version.
С версии: 3.0.0
public version ( ) : string | null
Результат string | null The file version.