Shopware\PluginCreator\Services\Template::fetch PHP Method

fetch() public method

Render the given template and return the result
public fetch ( $_template ) : string
$_template
return string
    public function fetch($_template)
    {
        return $this->doRender($_template, true);
    }

Usage Example

Example #1
0
 /**
  * Creates files from an array of template files
  *
  * @param $files
  */
 private function createFilesFromTemplate($files)
 {
     foreach ($files as $from => $to) {
         $fileContent = $this->template->fetch($from);
         $this->ioAdapter->createDirectory(dirname($this->getOutputDirectory() . $to));
         $this->ioAdapter->createFile($this->getOutputDirectory() . $to, $fileContent);
     }
 }