Exemplo n.º 1
0
 /**
  * Adds a stylesheet based on the dojo path (local or cdn). 
  * Method is static for situations where you need the stylesheets 
  * to render even if even the dijits haven't been called but
  * will during execution (AJAX calls).
  * 
  * @param string $stylesheet Path to stylesheet from base path.
  */
 public static function addStylesheet($path)
 {
     // Set static view if necessary
     if (null === self::$_view) {
         $viewRenderer = SZend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
         self::$_view = $viewRenderer->view;
         self::$_dojo = self::$_view->dojo();
     }
     // Determine path to use
     if (null === self::getScriptBase()) {
         if (self::$_dojo->useLocalPath()) {
             self::setScriptBase(self::$_dojo->getLocalPath());
         } else {
             self::setScriptBase(self::$_dojo->getCdnBase() . self::$_dojo->getCdnVersion());
         }
     }
     self::$_dojo->addStylesheet(self::getScriptBase() . $path);
 }