original_string: public function initialize()
      {
          if (true == $this->initialized) {
              return;
          }
  
          $this->initialized = true;
          
          if ($this->isEnabled()) {
              $headScript = $this->getView()->plugin('headScript');
              
              $headScript->prependFile($this->src);
              
              $options = array();
              foreach (array('async', 'parseOnLoad') as $property) {
                  if (null !== $this->$property) {
                      $options[$property] = $this->$property;
                  }
              }
              if (!empty($this->packages)) {
                  $options['packages'] = array_values($this->packages);
              }
              if (!empty($options)) {
                  $headScript->prependScript("dojoConfig=" . json_encode($options) . ";");
              }
              if (!empty($this->modules)) {
                  $require = 'require(["' . implode('", "', $this->modules) . '"]);';
                  $headScript->appendScript($require);
              }
          }
      }
code: public function initialize()
      {
          if (true == $this->initialized) {
              return;
          }
  
          $this->initialized = true;
          
          if ($this->isEnabled()) {
              $headScript = $this->getView()->plugin('headScript');
              
              $headScript->prependFile($this->src);
              
              $options = array();
              foreach (array('async', 'parseOnLoad') as $property) {
                  if (null !== $this->$property) {
                      $options[$property] = $this->$property;
                  }
              }
              if (!empty($this->packages)) {
                  $options['packages'] = array_values($this->packages);
              }
              if (!empty($options)) {
                  $headScript->prependScript("dojoConfig=" . json_encode($options) . ";");
              }
              if (!empty($this->modules)) {
                  $require = 'require(["' . implode('", "', $this->modules) . '"]);';
                  $headScript->appendScript($require);
              }
          }
      }
code_tokens: public function initialize ( ) { if ( true == $ this -> initialized ) { return ; } $ this -> initialized = true ; if ( $ this -> isEnabled ( ) ) { $ headScript = $ this -> getView ( ) -> plugin ( 'headScript' ) ; $ headScript -> prependFile ( $ this -> src ) ; $ options = array ( ) ; foreach ( array ( 'async' , 'parseOnLoad' ) as $ property ) { if ( null !== $ this -> $ property ) { $ options [ $ property ] = $ this -> $ property ; } } if ( ! empty ( $ this -> packages ) ) { $ options [ 'packages' ] = array_values ( $ this -> packages ) ; } if ( ! empty ( $ options ) ) { $ headScript -> prependScript ( "dojoConfig=" . json_encode ( $ options ) . ";" ) ; } if ( ! empty ( $ this -> modules ) ) { $ require = 'require(["' . implode ( '", "' , $ this -> modules ) . '"]);' ; $ headScript -> appendScript ( $ require ) ; } } }
docstring: Add Dojo configuration to HeadScript. Should only be called once.
docstring_tokens: Add Dojo configuration to HeadScript . Should only be called once .