original_string: public function element($name, array $data = [], array $options = [])
      {
          $options += ['callbacks' => false, 'cache' => null, 'plugin' => null];
          if (isset($options['cache'])) {
              $options['cache'] = $this->_elementCache($name, $data, $options);
          }
  
          $pluginCheck = $options['plugin'] !== false;
          $file = $this->_getElementFileName($name, $pluginCheck);
          if ($file && $options['cache']) {
              return $this->cache(function () use ($file, $data, $options) {
                  echo $this->_renderElement($file, $data, $options);
              }, $options['cache']);
          }
          if ($file) {
              return $this->_renderElement($file, $data, $options);
          }
  
          if (empty($options['ignoreMissing'])) {
              list ($plugin, $name) = pluginSplit($name, true);
              $name = str_replace('/', DIRECTORY_SEPARATOR, $name);
              $file = $plugin . static::NAME_ELEMENT . DIRECTORY_SEPARATOR . $name . $this->_ext;
              throw new MissingElementException([$file]);
          }
      }
code: public function element($name, array $data = [], array $options = [])
      {
          $options += ['callbacks' => false, 'cache' => null, 'plugin' => null];
          if (isset($options['cache'])) {
              $options['cache'] = $this->_elementCache($name, $data, $options);
          }
  
          $pluginCheck = $options['plugin'] !== false;
          $file = $this->_getElementFileName($name, $pluginCheck);
          if ($file && $options['cache']) {
              return $this->cache(function () use ($file, $data, $options) {
                  echo $this->_renderElement($file, $data, $options);
              }, $options['cache']);
          }
          if ($file) {
              return $this->_renderElement($file, $data, $options);
          }
  
          if (empty($options['ignoreMissing'])) {
              list ($plugin, $name) = pluginSplit($name, true);
              $name = str_replace('/', DIRECTORY_SEPARATOR, $name);
              $file = $plugin . static::NAME_ELEMENT . DIRECTORY_SEPARATOR . $name . $this->_ext;
              throw new MissingElementException([$file]);
          }
      }
code_tokens: public function element ( $ name , array $ data = [ ] , array $ options = [ ] ) { $ options += [ 'callbacks' => false , 'cache' => null , 'plugin' => null ] ; if ( isset ( $ options [ 'cache' ] ) ) { $ options [ 'cache' ] = $ this -> _elementCache ( $ name , $ data , $ options ) ; } $ pluginCheck = $ options [ 'plugin' ] !== false ; $ file = $ this -> _getElementFileName ( $ name , $ pluginCheck ) ; if ( $ file && $ options [ 'cache' ] ) { return $ this -> cache ( function ( ) use ( $ file , $ data , $ options ) { echo $ this -> _renderElement ( $ file , $ data , $ options ) ; } , $ options [ 'cache' ] ) ; } if ( $ file ) { return $ this -> _renderElement ( $ file , $ data , $ options ) ; } if ( empty ( $ options [ 'ignoreMissing' ] ) ) { list ( $ plugin , $ name ) = pluginSplit ( $ name , true ) ; $ name = str_replace ( '/' , DIRECTORY_SEPARATOR , $ name ) ; $ file = $ plugin . static :: NAME_ELEMENT . DIRECTORY_SEPARATOR . $ name . $ this -> _ext ; throw new MissingElementException ( [ $ file ] ) ; } }
docstring: Renders a piece of PHP with provided parameters and returns HTML, XML, or any other string.
  
  This realizes the concept of Elements, (or "partial layouts") and the $params array is used to send
  data to be used in the element. Elements can be cached improving performance by using the `cache` option.
  
  @param string $name Name of template file in the /src/Template/Element/ folder,
  or `MyPlugin.template` to use the template element from MyPlugin. If the element
  is not found in the plugin, the normal view path cascade will be searched.
  @param array $data Array of data to be made available to the rendered view (i.e. the Element)
  @param array $options Array of options. Possible keys are:
  - `cache` - Can either be `true`, to enable caching using the config in View::$elementCache. Or an array
  If an array, the following keys can be used:
  - `config` - Used to store the cached element in a custom cache configuration.
  - `key` - Used to define the key used in the Cache::write(). It will be prefixed with `element_`
  - `callbacks` - Set to true to fire beforeRender and afterRender helper callbacks for this element.
  Defaults to false.
  - `ignoreMissing` - Used to allow missing elements. Set to true to not throw exceptions.
  - `plugin` - setting to false will force to use the application's element from plugin templates, when the
  plugin has element with same name. Defaults to true
  @return string Rendered Element
  @throws \Cake\View\Exception\MissingElementException When an element is missing and `ignoreMissing`
  is false.
docstring_tokens: Renders a piece of PHP with provided parameters and returns HTML XML or any other string .