Returns the template path for given code.

@param string|null $code

@return string
9175
protected function getTemplatePath($code)
    {
        $code = $code ?: $this->getDefaultTemplateCode();
        $template = $this->get($code);

        return $template ? $template->getPath() : $this->defaultTemplatePath;
    }
1171284
protected function getPathToTemplates($template = null)
    {
        $template = Helpers::getPathWithSlash($template ?: Config::getDefaultTemplateName());
        $basePath = base_path(Config::getTemplatesPath() . $template);
        $path = Helpers::getPathWithSlash($basePath);

        if (!$this->isFileExists($path)) {
            throw new Exception('Invalid template. Make sure the following path exists: "' . $path . '"');
        }

        return $path;
    }
661054
public function getLocaleByCode($code)
    {
        $locales = $this->getLocales();
        if (array_key_exists($code, $locales)) {
            return $locales[$code];
        }
    }
1312377
public static function fromIso($code)
    {
        $countryCode = strtoupper($code);
        $table = self::isoCodes();

        if (!array_key_exists($countryCode, $table)) {
            return null;
        }

        return $table[$countryCode];
    }
831232
public function locale($code, $locale = null)
    {
        $name = Intl::getLocaleBundle()->getLocaleName($code, $locale ?: $this->localeDetector->getLocale());

        return $name ? $this->fixCharset($name) : '';
    }
589646
public function getCommonFile($langcode = null)
    {
        if (!isset($langcode)) {
            $langcode = $this->langcode;
        }

        return $this->getCompiledDirectory($langcode) . "/$langcode.csv";
    }
1013772
public static function getHierarchyNextChild($code)
    {
        $hierarchyField = static::getHierarchyField();
        $child_length = static::getHierarchyChildLength($code);
        if ($child_length < 0) {
            return false;
        }

        $max = static::query()->whereStartsWith($hierarchyField, $code, $child_length)->max($hierarchyField);
        if ($max === null) {
            return $code . str_pad('', $child_length - strlen($code) - 1, '0') . '1';
        } else {
            return static::_calcHierarchyNextChild($max);
        }
    }
111487
public function getAddress($code): string
    {
        return $this->getProvince($code) . $this->getCity($code) . $this->getCounty($code);
    }
1145009
public static function do_template( $code, $obj = null ) {

		if ( ! empty( $obj ) ) {
			self::$obj =& $obj;
		} else {
			$obj =& self::$obj;
		}

		if ( empty( $obj ) || ! is_object( $obj ) ) {
			return '';
		}

		$code = trim( $code );

		if ( false !== strpos( $code, '<?' ) && ( ! defined( 'PODS_DISABLE_EVAL' ) || ! PODS_DISABLE_EVAL ) ) {
			pods_deprecated( 'Pod Template PHP code has been deprecated, please use WP Templates instead of embedding PHP.', '2.3' );

			$code = str_replace( '$this->', '$obj->', $code );

			ob_start();

			eval( "?>$code" );

			$out = ob_get_clean();
		} else {
			$out = $code;
		}

		$out = $obj->do_magic_tags( $out );

		return apply_filters( 'pods_templates_do_template', $out, $code, $obj );
	}
1105992
public function getCode()
    {
        $locator = new TemplateLocator(new FileLocator($this->getTemplateDirs()));
        $templateNameParser = new TemplateNameParser();
        $loader = new FilesystemLoader($locator, $templateNameParser);
        $twig = new \Twig_Environment(
            $loader,
            array(
                'autoescape' => false,
                'strict_variables' => true,
                'debug' => true,
                'cache' => $this->getGenerator()->getTempDir(),
            )
        );

        $this->addTwigExtensions($twig, $loader);
        $this->addTwigFilters($twig);
        $template = $twig->loadTemplate($this->getTemplateName());

        $variables = $this->getVariables();
        $variables['builder'] = $this;

        return $template->render($variables);
    }
1010551
public static function appPath(?string $app = null): ?string
    {
        self::initialize();
        if ($app === null) {
            $app = '*';
        }
        if (isset(self::$repositories[$app])) {
            return call_user_func([self::$repositories[$app], 'getPath']);
        }
        return null;
    }
1349851
private function getTemplateArgumentPath()
    {
        if ($this->customTemplatePath !== null) {
            return str_finish($this->customTemplatePath, '/');
        }

        return str_finish(find_tse_template($this->getTemplateName()), '/');
    }
180631
private function getZoneMemberByCode($code)
    {
        $zoneMember = $this->zoneMemberRepository->findOneBy(['code' => $code]);
        Assert::notNull(
            $zoneMember,
            sprintf('Zone member with code %s does not exist.', $code)
        );

        return $zoneMember;
    }
1007792
private function _getCode(){
        $code = null;
        //try{
            $text = $this->text;
            $textColor = new CINColor($this->foregroundColor);
            $backgroudColor = new CINColor($this->backgroundColor);
            $fontPath = isset($this->font) ? $this->font : $this->_getDefaultFont();

            $font = new CINFontFile($fontPath, (is_int($this->fontSize)) ? $this->fontSize : 18);

            $codeClass = "\\CodeItNow\\BarcodeBundle\\Generator\\".$this->barcodeType;
            $code = new $codeClass();
            if($this->scale){
                $code->setScale($this->scale); // Resolution
            }
            if($this->thickness){
                $code->setThickness($this->thickness); // Thickness
            }
            if($this->label !== FALSE){
                $code->setLabel($this->label);
            }
            if($this->noLengthLimit){
                $code->setNoLengthLimit($this->noLengthLimit);
            }
            if($this->allowsUnknownIdentifier){
                $code->setAllowsUnknownIdentifier($this->allowsUnknownIdentifier);
            }
            $code->setForegroundColor($textColor); // Color of bars
            $code->setBackgroundColor($backgroudColor); // Color of spaces
            $code->setFont($font); // Font (or 0)
            $code->parse($text); // Text
        //} catch (\Exception $ex) {
            
        //}
        return $code;
    }
726375
public function getStatusText($code = null)
    {
        if ($code === null) {
            return $this->_context->status_text;
        } else {
            $texts = [
                200 => 'OK',
                201 => 'Created',
                202 => 'Accepted',
                203 => 'Non-Authoritative Information',
                204 => 'No Content',
                205 => 'Reset Content',
                206 => 'Partial Content',
                207 => 'Multi-Status',
                208 => 'Already Reported',
                301 => 'Moved Permanently',
                302 => 'Found',
                303 => 'See Other',
                304 => 'Not Modified',
                305 => 'Use Proxy',
                307 => 'Temporary Redirect',
                308 => 'Permanent Redirect',
                400 => 'Bad Request',
                401 => 'Unauthorized',
                402 => 'Payment Required',
                403 => 'Forbidden',
                404 => 'Not Found',
                405 => 'Method Not Allowed',
                406 => 'Not Acceptable',
                407 => 'Proxy Authentication Required',
                408 => 'Request Time-out',
                409 => 'Conflict',
                410 => 'Gone',
                411 => 'Length Required',
                412 => 'Precondition Failed',
                413 => 'Request Entity Too Large',
                414 => 'Request-URI Too Long',
                415 => 'Unsupported Media Type',
                416 => 'Requested range unsatisfiable',
                417 => 'Expectation failed',
                418 => 'I\'m a teapot',
                421 => 'Misdirected Request',
                422 => 'Unprocessable entity',
                423 => 'Locked',
                424 => 'Method failure',
                425 => 'Unordered Collection',
                426 => 'Upgrade Required',
                428 => 'Precondition Required',
                429 => 'Too Many Requests',
                431 => 'Request Header Fields Too Large',
                449 => 'Retry With',
                450 => 'Blocked by Windows Parental Controls',
                500 => 'Internal Server Error',
                501 => 'Not Implemented',
                502 => 'Bad Gateway or Proxy Error',
                503 => 'Service Unavailable',
                504 => 'Gateway Time-out',
                505 => 'HTTP Version not supported',
                507 => 'Insufficient storage',
                508 => 'Loop Detected',
                509 => 'Bandwidth Limit Exceeded',
                510 => 'Not Extended',
                511 => 'Network Authentication Required',
            ];

            return isset($texts[$code]) ? $texts[$code] : 'App Error';
        }
    }
802861
public function get($code = null): string
    {
        if (!$this->validate($code)) {
            throw new \InvalidArgumentException('Invalid code');
        }

        return isset(self::$codes[$code]) ? self::$codes[$code] : '';
    }
1150448
private function getPermission($code)
    {
        if (isset($this->permissions[$code])) {
            return $this->permissions[$code];
        }

        try {
            return $this->permissionProvider->getPermission($code);
        } catch (PermissionNotFoundException $exception) {
            return null;
        }
    }