本文整理汇总了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;
}