Get stub templates.

@return string
7045
public function getStub()
    {
        $parser = $this->getNameParser();

        if ($this->existing) {
            $this->name = 'create_'.str_plural($this->name).'_table';
            
            $parser = $this->getNameParser();
                
            $fields = (new TableDumper($parser->getTable()))->toSchema();

            $stub = Stub::create('/migration/create.stub', [
                'class' => $this->getClass(),
                'table' => $parser->getTable(),
                'fields' => (new SchemaParser($fields))->render(),
            ]);
        }
        elseif ($parser->isCreate()) {
            $stub = Stub::create('/migration/create.stub', [
                'class' => $this->getClass(),
                'table' => $parser->getTable(),
                'fields' => $this->getSchemaParser()->render(),
            ]);
        } elseif ($parser->isAdd()) {
            $stub = Stub::create('/migration/add.stub', [
                'class' => $this->getClass(),
                'table' => $parser->getTable(),
                'fields_up' => $this->getSchemaParser()->up(),
                'fields_down' => $this->getSchemaParser()->down(),
            ]);
        } elseif ($parser->isDelete()) {
            $stub = Stub::create('/migration/delete.stub', [
                'class' => $this->getClass(),
                'table' => $parser->getTable(),
                'fields_down' => $this->getSchemaParser()->up(),
                'fields_up' => $this->getSchemaParser()->down(),
            ]);
        } elseif ($parser->isDrop()) {
            $stub = Stub::create('/migration/drop.stub', [
                'class' => $this->getClass(),
                'table' => $parser->getTable(),
                'fields' => $this->getSchemaParser()->render(),
            ]);
        } else {
            $stub = false;
        }

        if ($stub) {
            return $stub->render();
        }

        return parent::getStub();
    }
528832
public function getTemplateList()
    {
        $templates = [];
        foreach ($this->storage->findTemplates() as $site) {
            $templates[$site->id] = $site->title;
        }

        return $templates;
    }
1237157
public function getTemplate($type)
    {
        if ($this->apiLumen) {
            $template = file_get_contents(__DIR__ . '/stubs/api/' . $type . '.stub');
        } else {
            $template = file_get_contents(__DIR__ . '/stubs/' . $type . '.stub');
        }

        if ($template === false) {
            $this->error('CRUD Template [' . $type  . '] not found.');
            die;
        }

       return $template;
    }
316642
protected function getStub()
    {
        if ($this->collection()) {
            $stub = config('stubs.path') . '/resource-collection.stub';
        } else {
            $stub = config('stubs.path') . '/resource.stub';
        }

        return file_exists($stub) ? $stub : parent::getStub();
    }
699152
private function getTemplate()
    {
        if ($this->template) {
            return $this->template;
        }

        return $this->template = $this->twig->load('@EkynaCms/Editor/Block/tabs.html.twig');
    }
37919
public function getTemplates()
    {
        $template = parent::getTemplates();

        if ($default = $this->defaultTemplate) {
            $key = array_search('FormField', $template);

            if ($key !== false) {
                $default[$key] = $this->defaultTemplate;
            }
        }

        return $template;
    }
627858
public function generate()
    {
        $stub = array();

        if ('' !== $this->shebang) {
            $stub[] = $this->shebang;
        }

        $stub[] = '<?php';

        if (null !== $this->banner) {
            $stub[] = $this->getBanner();
        }

        if ($this->extract) {
            $stub[] = join("\n", $this->extractCode['constants']);

            if ($this->extractForce) {
                $stub = array_merge($stub, $this->getExtractSections());
            }
        }

        $stub = array_merge($stub, $this->getPharSections());

        if ($this->extract) {
            if ($this->extractForce) {
                if ($this->index && !$this->web) {
                    $stub[] = "require \"\$dir/{$this->index}\";";
                }
            } else {
                end($stub);

                $stub[key($stub)] .= ' else {';

                $stub = array_merge($stub, $this->getExtractSections());

                if ($this->index) {
                    $stub[] = "require \"\$dir/{$this->index}\";";
                }

                $stub[] = '}';
            }

            $stub[] = join("\n", $this->extractCode['class']);
        }

        $stub[] = "__HALT_COMPILER();";

        return join("\n", $stub);
    }
292441
protected function getStub()
    {
        $key = $this->getOptionStubKey();

        // get the stub path
        $stub = config('generators.' . $key);

        if (is_null($stub)) {
            $this->error('The stub does not exist in the config file - "' . $key . '"');
            exit;
        }

        return $stub;
    }
1157007
protected function getDependencyTemplateResources()
    {
        $templateResources = [];

        // Run through all component dependencies
        foreach ($this->dependencies as $dependency) {
            $templateResources[] = $this->objectManager->get($dependency)->getPreviewTemplateResources();
        }

        return $templateResources;
    }
139614
protected function getTemplate()
    {
        //if no template
        if(!$this->template) {
            //Action folder and template folder
            //are in the same directoryby default

            // Sample\Namespace\Action\Can\Be\Anywhere
            $index = 'Action\\';
            $root = strpos(get_class($this), $index);
            $root += strlen($index);

            $this->template = eve('string')
                // \Can\Be\Anywhere
                ->set('\\'.substr(get_class($this), $root))
                // /Can/Be/Anywhere
                ->str_replace('\\', DIRECTORY_SEPARATOR)
                // /can/be/anywhere
                ->strtolower()
                // jic
                ->str_replace('//', '/')
                //done
                ->get();
        }

        return $this->template;
    }
933420
protected function getStub()
    {
        $stub = null;

        if ($this->option('parent')) {
            $stub = config('stubs.path') . '/controller.nested.stub';
        } elseif ($this->option('model')) {
            $stub = config('stubs.path') . '/controller.model.stub';
        } elseif ($this->option('invokable')) {
            $stub = config('stubs.path') . '/controller.invokable.stub';
        } elseif ($this->option('resource')) {
            $stub = config('stubs.path') . '/controller.stub';
        }

        if ($this->option('api') && is_null($stub)) {
            $stub = config('stubs.path') . '/controller.api.stub';
        } elseif ($this->option('api') && !is_null($stub) && !$this->option('invokable')) {
            $stub = str_replace('.stub', '.api.stub', $stub);
        }

        $stub = $stub ?? config('stubs.path') . '/controller.plain.stub';

        return file_exists($stub) ? $stub : parent::getStub();
    }
619692
public function getTemplates($dc)
	{
		$prefix = '';

		if($dc instanceof \MultiColumnWizard)
		{
			$dc->field = $dc->strField;
			$dc->table = $dc->strTable;
		}

		if(isset($GLOBALS['TL_DCA'][$dc->table]['fields'][$dc->field]['eval']['templatePrefix']))
		{
			$prefix = $GLOBALS['TL_DCA'][$dc->table]['fields'][$dc->field]['eval']['templatePrefix'];
		}

		$key = null;

		if(isset($GLOBALS['TL_DCA'][$dc->table]['fields'][$dc->field]['eval']['templateThemeId']))
		{
			$key = $GLOBALS['TL_DCA'][$dc->table]['fields'][$dc->field]['eval']['templateThemeId'];
		}

		$key = $key == '' ? null : $dc->activeRecord->$key;

		return $this->getTemplateGroup($prefix, $key);
	}
714628
public function getListTemplate()
    {
        if (null === $this->listTemplate) {
            $template = rtrim($this->getTemplatePrefix(), '/') . '/' . $this->getListSuffix();
            $this->setListTemplate($template);
        }

        return $this->listTemplate;
    }
957805
protected function getStub()
    {
        return config('generators.' . strtolower($this->type) . ($this->input->hasOption('plain') && $this->option('plain') ? '_plain' : '') . '_stub');
    }
675086
public function component_templates() {
		$output = null;
		foreach ( $this->modals as $modal ) {

			$width  = 'data-width="950"';
			$height = 'data-height="550"';

			$output .= '<script type="text/html" ' . $width . ' ' . $height . ' id="' . esc_attr( $this->id() ) . '-' . esc_attr( $modal->slug ) . '">';
			if ( isset( $modal->struct['preview'] ) ) {
				$template = uix()->add( 'control', $modal->slug, array(
					'type'     => 'template',
					'template' => $modal->struct['preview'],
				) );

				$output .= $template->render();
			} else {
				$output .= '<div>' . $modal->struct['label'] . '</div>';
			}
			$output .= '</script>';

		}

		return $output;
	}
690395
public function getTemplate()
    {
        if (null === $this->template) {
            $this->template = $this->getTemplatePathDefault('layout');
        }

        return $this->template;
    }
389194
public function buildTemplate()
    {
        if (!empty($this->template)) {
            return $this->template;
        }

        $actions = [];
        foreach ($this->actionBuilders as $actionBuilder) {
            $actions[] = $actionBuilder->buildTemplateAction();
        }

        $this->template = [
            'type' => TemplateType::CONFIRM,
            'text' => $this->text,
            'actions' => $actions,
        ];

        return $this->template;
    }