@param \Twig_Template $scope
@param null|string    $name

@return mixed|string
978344
public function getUiPageActions(\Twig_Template $scope, $name = null)
    {
        $file = $scope->getTemplateName();
        $pattern = '/ui\:(.*):(.*)\.html\.twig/';

        if ($name) {
            $file = preg_replace($pattern, sprintf('ui:$1/Actions:%s.html.twig', $name), $file);
        } else {
            $file = preg_replace($pattern, 'ui:$1/Actions:${2}.html.twig', $file);
        }

        return $file;
    }
581725
protected function getAbstractFileForm($id, $name, $context = [])
    {
        /** @var File $file */
        $file = File::get()->byID($id);

        if (!$file) {
            $this->jsonError(404);
            return null;
        }

        if (!$file->canView()) {
            $this->jsonError(403, _t(
                __CLASS__.'.ErrorItemPermissionDenied',
                "You don't have the necessary permissions to modify {ObjectTitle}",
                [ 'ObjectTitle' => $file->i18n_singular_name() ]
            ));
            return null;
        }

        // Pass to form factory
        $showLinkText = $this->getRequest()->getVar('requireLinkText');
        $augmentedContext = array_merge(
            $context,
            [ 'Record' => $file, 'RequireLinkText' => isset($showLinkText) ]
        );
        $scaffolder = $this->getFormFactory($file);
        $form = $scaffolder->getForm($this, $name, $augmentedContext);

        // Set form action handler with ID included
        $form->setRequestHandler(
            LeftAndMainFormRequestHandler::create($form, [ $id ])
        );

        // Configure form to respond to validation errors with form schema
        // if requested via react.
        $form->setValidationResponseCallback(function (ValidationResult $error) use ($form, $id, $name) {
            $schemaId = Controller::join_links($this->Link('schema'), $name, $id);
            return $this->getSchemaResponse($schemaId, $form, $error);
        });

        return $form;
    }
705781
protected function getParameter($name)
    {
        return array_key_exists($name, $this->templateVars)?$this->templateVars[$name]:null;
    }
865031
public function getDirective($name)
    {
        foreach ($this->getDirectives() as $directive) {
            if ($directive->getName() === $name) {
                return $directive;
            }
        }
        return NULL;
    }
259760
protected function findTemplate($name)
    {
        if (!$this->isLoadableTemplate($name)) {
            throw new \Twig_Error_Loader(sprintf('Malformed namespaced template name "%s" (expecting "%stemplate_name").', $name, $this->prefix));
        }

        $templateIdentifier = substr($name, strlen($this->prefix));
        $template = $this->repository->find($templateIdentifier);
        if ($template === null) {
            throw new \Twig_Error_Loader(sprintf('Unable to find template "%s".', $name));
        }
        if (!($template instanceof TemplateInterface)) {
            throw new \Twig_Error_Loader(sprintf('Unexpected template type "%s" found for template "%s".', get_class($template), $name));
        }
        if ($template instanceof TranslatableTemplateInterface) {
            /** @var TranslatableTemplateInterface $template */
            $locale = $this->getCurrentLocale();
            $template->setCurrentLocale($locale);
        }

        return $template;
    }
1127161
public function getTemplate($name)
    {
        if (!isset($this->templates[$name])) {
            throw new MissingTemplateException(sprintf('Unable to get template for "%s", there is no such template configured.', $name));
        }

        $template = (string) $this->templates[$name];
        if ('' === $template) {
            throw new MissingTemplateException(sprintf('Unable to get template for "%s", it seems the template value is empty. Make sure you enabled the proper section and configured a proper value.', $name));
        }

        return $template;
    }
1372952
public function getBlockFromTemplate($twig, $template, $block, $vars = [])
    {
        return $twig
            ->loadTemplate($template)
            ->renderBlock($block, $vars)
        ;
    }
772949
static function laraform($name = null) {
        $el = new ElementDaterangepickerTwbs($name);
        $el->setWrapClass('js-daterangepicker-twbs');
        $el->putTextTwbs('from')->setAttribute('style','display:none');
        $el->putTextTwbs('to')->setAttribute('style','display:none');
        $el->putStaticTwbs('<div class="col-lg-12"><i class="fa fa-calendar"></i>&nbsp;<span></span> <b class="caret"></b></div>');
        //$el->putStaticTwbs('<i class="fa fa-calendar"></i>&nbsp;<span></span> <b class="caret"></b>');
        return $el;
    }
1162241
public   function getTemplate($name)
    {
          foreach($this->templates as $handler){
              
             if(is_string($handler)){
                 $template = $handler($name);
             }                             
             
              
              if(strlen($template) >0){
                  return $template;
              }
          }
    }
90597
public function displayBlock($name, array $context, array $blocks = array())
    {
        $name = (string) $name;

        if (isset($blocks[$name])) {
            $template = $blocks[$name][0];
            $block = $blocks[$name][1];
            unset($blocks[$name]);
        } elseif (isset($this->blocks[$name])) {
            $template = $this->blocks[$name][0];
            $block = $this->blocks[$name][1];
        } else {
            $template = null;
            $block = null;
        }

        if (null !== $template) {
            try {
                $template->$block($context, $blocks);
            } catch (Twig_Error $e) {
                throw $e;
            } catch (Exception $e) {
                throw new Twig_Error_Runtime(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $template->getTemplateName(), $e);
            }
        } elseif (false !== $parent = $this->getParent($context)) {
            $parent->displayBlock($name, $context, array_merge($this->blocks, $blocks));
        }
    }
78204
private function getBlockByName($name, $resourcesName)
    {
        if (isset($this->blocks[$name])) {
            return [$name => $this->blocks[$name]];
        }

        foreach ($this->{$resourcesName} as &$template) {
            if (!$template instanceof Twig_Template) {
                $template = $this->twig->loadTemplate($template['template']);
            }

            $tpl = $template;

            $block = $this->searchBlock($name, $tpl);
            if ($block !== null) {
                $this->blocks[$name] = $block;

                return [$name => $block];
            }
        }

        return [];
    }
235427
public function makeCacheKey($scope, $name, $reversed)
	{
		$cacheKey = $scope.'::'.$name;

		if ($reversed)
		{
			$cacheKey .= '::reversed';
		}

		return $cacheKey;
	}
1036748
protected function getFileOrFail($name)
    {
        if (!$this->filesystem->has($this->resolveTemplateName($name))) {
            throw new Twig_Error_Loader('Template could not be found on the given filesystem');
        }

        $fileObject = $this->filesystem->get($this->resolveTemplateName($name));
        if ($fileObject->isDir()) {
            throw new Twig_Error_Loader('Cannot use directory as template');
        }

        return $fileObject;
    }
265363
public function displayParentBlock($name, array $context, array $blocks = array())
    {
        $name = (string) $name;

        if (isset($this->traits[$name])) {
            $this->traits[$name][0]->displayBlock($name, $context, $blocks);
        } elseif (false !== $parent = $this->getParent($context)) {
            $parent->displayBlock($name, $context, $blocks);
        } else {
            throw new Twig_Error_Runtime(sprintf('The template has no parent and no traits defining the "%s" block', $name), -1, $this->getTemplateName());
        }
    }
423244
protected function replaceTemplateExtension($name, $device)
    {
        if (strstr($name, 'twig')) {
            return str_replace('html.twig', $device . '.html.twig', $name);
        }
        if (strstr($name, 'smarty')) {
            return str_replace('html.smarty', $device . '.html.smarty', $name);
        }

        return $name;
    }
478486
public function load($name)
    {
        if (!isset($this->templates[$name])) {
            $this->templates[$name] = $this->loadFile($name);
        }

        return $this->templates[$name];
    }
226316
public function getLastInsertId($name = NULL)
	{
		$query = $this->query("SELECT SCOPE_IDENTITY() AS Result");
		
		if(!$query)
			return false;
			
		return intval($this->fetch($query, LikePDO::FETCH_OBJ)->Result);
	}