當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CSS::getInstance方法代碼示例

本文整理匯總了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'));
 }
開發者ID:ponticlaro,項目名稱:bebop-core,代碼行數:33,代碼來源:Bebop.php

示例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;
 }
開發者ID:ponticlaro,項目名稱:bebop-cms,代碼行數:27,代碼來源:StyleConfigItem.php


注:本文中的CSS::getInstance方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。