AssetDefinition
in package
FinalYes
1件のJS/CSSアセット登録を表す値オブジェクト。
Table of Contents
Constants
- POSITION_BODY_END = 'body_end'
- POSITION_HEAD = 'head'
- TYPE_INLINE_SCRIPT = 'inline-script'
- TYPE_INLINE_STYLE = 'inline-style'
- TYPE_RAW = 'raw'
- TYPE_SCRIPT = 'script'
- TYPE_STYLE = 'style'
Properties
- $attrs : array<string|int, mixed>
- $content : string|null
- $deps : array<string|int, mixed>
- $handle : string
- $position : string
- $src : string|null
- $type : string
- $version : string|null
Methods
- inlineScript() : self
- inlineStyle() : self
- raw() : self
- Vite の出力等、既に組み立て済みの HTML をそのまま配置するための脱出口。 $html はプラグイン作者が組み立てた信頼済みの文字列として扱う(エスケープしない)。
- script() : self
- style() : self
- __construct() : mixed
- createWithContent() : self
- createWithSrc() : self
Constants
POSITION_BODY_END
public
mixed
POSITION_BODY_END
= 'body_end'
POSITION_HEAD
public
mixed
POSITION_HEAD
= 'head'
TYPE_INLINE_SCRIPT
public
mixed
TYPE_INLINE_SCRIPT
= 'inline-script'
TYPE_INLINE_STYLE
public
mixed
TYPE_INLINE_STYLE
= 'inline-style'
TYPE_RAW
public
mixed
TYPE_RAW
= 'raw'
TYPE_SCRIPT
public
mixed
TYPE_SCRIPT
= 'script'
TYPE_STYLE
public
mixed
TYPE_STYLE
= 'style'
Properties
$attrs read-only
public
array<string|int, mixed>
$attrs
$content read-only
public
string|null
$content
$deps read-only
public
array<string|int, mixed>
$deps
$handle read-only
public
string
$handle
$position read-only
public
string
$position
$src read-only
public
string|null
$src
$type read-only
public
string
$type
$version read-only
public
string|null
$version
Methods
inlineScript()
public
static inlineScript(string $handle, string $code[, array{deps?: string[], position?: string, attrs?: array} $options = [] ]) : self
Parameters
- $handle : string
- $code : string
-
$options
: array{deps?: string[], position?: string, attrs?: array
} = []
Return values
selfinlineStyle()
public
static inlineStyle(string $handle, string $code[, array{deps?: string[], position?: string, attrs?: array} $options = [] ]) : self
Parameters
- $handle : string
- $code : string
-
$options
: array{deps?: string[], position?: string, attrs?: array
} = []
Return values
selfraw()
Vite の出力等、既に組み立て済みの HTML をそのまま配置するための脱出口。 $html はプラグイン作者が組み立てた信頼済みの文字列として扱う(エスケープしない)。
public
static raw(string $handle, string $html[, array{deps?: string[], position?: string} $options = [] ]) : self
Parameters
- $handle : string
- $html : string
- $options : array{deps?: string[], position?: string} = []
Return values
selfscript()
public
static script(string $handle, string $src[, array{deps?: string[], position?: string, attrs?: array, version?: ?string} $options = [] ]) : self
Parameters
- $handle : string
- $src : string
-
$options
: array{deps?: string[], position?: string, attrs?: array
, version?: ?string} = []
Return values
selfstyle()
public
static style(string $handle, string $src[, array{deps?: string[], position?: string, attrs?: array, version?: ?string} $options = [] ]) : self
Parameters
- $handle : string
- $src : string
-
$options
: array{deps?: string[], position?: string, attrs?: array
, version?: ?string} = []
Return values
self__construct()
private
__construct(string $handle, string $type, string|null $src, string|null $content, array<string|int, string> $deps, string $position, array<string, string|bool> $attrs, string|null $version) : mixed
Parameters
- $handle : string
- $type : string
- $src : string|null
- $content : string|null
- $deps : array<string|int, string>
- $position : string
- $attrs : array<string, string|bool>
- $version : string|null
createWithContent()
private
static createWithContent(string $handle, string $type, string $content, string $defaultPosition, array{deps?: string[], position?: string, attrs?: array} $options) : self
Parameters
- $handle : string
- $type : string
- $content : string
- $defaultPosition : string
-
$options
: array{deps?: string[], position?: string, attrs?: array
}
Return values
selfcreateWithSrc()
private
static createWithSrc(string $handle, string $type, string $src, string $defaultPosition, array{deps?: string[], position?: string, attrs?: array, version?: ?string} $options) : self
Parameters
- $handle : string
- $type : string
- $src : string
- $defaultPosition : string
-
$options
: array{deps?: string[], position?: string, attrs?: array
, version?: ?string}