original_string: protected function _renderElement($file, $data, $options)
      {
          $current = $this->_current;
          $restore = $this->_currentType;
          $this->_currentType = static::TYPE_ELEMENT;
  
          if ($options['callbacks']) {
              $this->dispatchEvent('View.beforeRender', [$file]);
          }
  
          $element = $this->_render($file, array_merge($this->viewVars, $data));
  
          if ($options['callbacks']) {
              $this->dispatchEvent('View.afterRender', [$file, $element]);
          }
  
          $this->_currentType = $restore;
          $this->_current = $current;
  
          return $element;
      }
code: protected function _renderElement($file, $data, $options)
      {
          $current = $this->_current;
          $restore = $this->_currentType;
          $this->_currentType = static::TYPE_ELEMENT;
  
          if ($options['callbacks']) {
              $this->dispatchEvent('View.beforeRender', [$file]);
          }
  
          $element = $this->_render($file, array_merge($this->viewVars, $data));
  
          if ($options['callbacks']) {
              $this->dispatchEvent('View.afterRender', [$file, $element]);
          }
  
          $this->_currentType = $restore;
          $this->_current = $current;
  
          return $element;
      }
code_tokens: protected function _renderElement ( $ file , $ data , $ options ) { $ current = $ this -> _current ; $ restore = $ this -> _currentType ; $ this -> _currentType = static :: TYPE_ELEMENT ; if ( $ options [ 'callbacks' ] ) { $ this -> dispatchEvent ( 'View.beforeRender' , [ $ file ] ) ; } $ element = $ this -> _render ( $ file , array_merge ( $ this -> viewVars , $ data ) ) ; if ( $ options [ 'callbacks' ] ) { $ this -> dispatchEvent ( 'View.afterRender' , [ $ file , $ element ] ) ; } $ this -> _currentType = $ restore ; $ this -> _current = $ current ; return $ element ; }
docstring: Renders an element and fires the before and afterRender callbacks for it
  and writes to the cache if a cache is used
  
  @param string $file Element file path
  @param array $data Data to render
  @param array $options Element options
  @return string
  @triggers View.beforeRender $this, [$file]
  @triggers View.afterRender $this, [$file, $element]
docstring_tokens: Renders an element and fires the before and afterRender callbacks for it and writes to the cache if a cache is used