本文整理匯總了PHP中CSS::getInstance方法的典型用法代碼示例。如果您正苦於以下問題:PHP CSS::getInstance方法的具體用法?PHP CSS::getInstance怎麽用?PHP CSS::getInstance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CSS
的用法示例。
在下文中一共展示了CSS::getInstance方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
/**
* Checks environment and build defaults
*
*/
protected function __construct()
{
// Instantiate Feature Manager
FeatureManager::getInstance();
// Instantiate Context Manager
ContextManager::getInstance();
// Instantiate URLs Manager
UrlManager::getInstance();
// Instantiate Paths Manager & set Bebop root directory
PathManager::getInstance()->set('bebop', __DIR__);
// Set default Media Mvc Model modifications on the Bebop HTTP API
Media::onContext('api', function ($media) {
$media->cacheAllImageSizes();
});
// Set default views directory
View::setViewsDir(PathManager::getInstance()->get('theme', 'views'));
// Instantiate CSS Manager
CSS::getInstance();
// Instantiate JS Manager
JS::getInstance();
// Instantiate UI
UI::getInstance();
// Instantiate Api
self::Api();
// Instantiate Config
Config::getInstance();
// Shortcode support for in editor use
add_shortcode('Bebop', array($this, '__bebopShortcodes'));
}
示例2: handleAction
/**
* Registers script
*
* @param object $hook_name JS Hook instance
* @return object Current object
*/
protected function handleAction($hook_name, $action)
{
if ($hook = CSS::getInstance()->getHook($hook_name)) {
if ($action == 'register') {
// Get dependencies
$deps = $this->config->get('deps') ?: [];
// Enqueue dependencies
if ($deps) {
foreach ($deps as $dep_handle) {
// Publish event
$this->getEventEmitter()->publish("cms.config.styles.{$dep_handle}", ['action' => 'enqueue_as_dependency', 'hooks' => [$hook_name]]);
}
}
// Register script
$hook->register($this->config->get('handle'), $this->config->get('src'), $deps, $this->config->get('version') ?: null, $this->config->get('in_footer') ?: null);
} else {
$hook->{$action}($this->config->get('handle'));
}
}
return $this;
}