PHP 클래스 Themosis\Asset\AssetFactory

파일 보기 프로젝트 열기: themosis/framework

보호된 프로퍼티들

프로퍼티 타입 설명
$aliasPrefix string Alias prefix in order to register assets into the service container.
$allowedAssets array A list of authorized assets to add.
$container Themosis\Foundation\Application The service container.
$finder AssetFinder The AssetFinder instance.

공개 메소드들

메소드 설명
__construct ( AssetFinder $finder, Application $container ) Constructor.
add ( string $handle, string $path, array | boolean $deps = [], string $version = '1.0', boolean | string $mixed = null, string $type = '' ) : Asset | WP_Error Add an asset to the application.

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( AssetFinder $finder, Application $container )
$finder AssetFinder
$container Themosis\Foundation\Application

add() 공개 메소드

NOTE : By default the path is relative to one of the registered paths. Make sure your asset is unique by handle and paths/url. You can also pass an external url.
public add ( string $handle, string $path, array | boolean $deps = [], string $version = '1.0', boolean | string $mixed = null, string $type = '' ) : Asset | WP_Error
$handle string The asset handle name.
$path string The URI to the asset or the absolute URL.
$deps array | boolean An array with asset dependencies or false.
$version string The version of your asset.
$mixed boolean | string Boolean if javascript file | String if stylesheet file.
$type string 'script' or 'style'.
리턴 Asset | WP_Error

프로퍼티 상세

$aliasPrefix 보호되어 있는 프로퍼티

Alias prefix in order to register assets into the service container.
protected string $aliasPrefix
리턴 string

$allowedAssets 보호되어 있는 프로퍼티

A list of authorized assets to add.
protected array $allowedAssets
리턴 array

$container 보호되어 있는 프로퍼티

The service container.
protected Application,Themosis\Foundation $container
리턴 Themosis\Foundation\Application

$finder 보호되어 있는 프로퍼티

The AssetFinder instance.
protected AssetFinder,Themosis\Asset $finder
리턴 AssetFinder