Returns email content.
@param string $name content name
@return Content
@since 0.2
331379
public static function fill($name)
    {
        $email = Content::find()->where(['name' => $name])->limit(1)->one();
        if (empty($email)) {
            $email = Content::prepareDefault($name);
        }
        return $email;
    }
362215
public function getHeaderValue($name)
    {
        $pattern = '#' . $name . ': (.*)#i';
        if (preg_match($pattern, $this->getResponseHeader(), $match)) {
            return $match[1];
        } else {
            return null;
        }
    }
401922
public static function prepareDefault($name)
    {
        $default = static::defaultContent($name);
        if (empty($default)) {
            return false;
        }

        $content = new static;
        $content->topic = $default['topic'];
        $content->content = $default['content'];
        return $content;
    }
752096
public function get($name)
    {
        $name = ltrim($name, '\\');
        if (! isset($this->instances[$name])) {
            $this->instances[$name] = $this->newInstance($name);
        }
        return $this->instances[$name];
    }
291597
public function url($name) {
        if ( key_exists($name, $this->_url) ) {
            return $this->_url[$name];
        }
        
        return htmlentities(utf8_decode(filter_input(INPUT_GET, $name, FILTER_SANITIZE_STRING)));
    }
1147258
private function get_contents_to($name)
    {
        if ($this->pos === $this->input_length) {
            return array('', 'TK_EOF');
        }
        $input_char = '';
        $content = '';

        $reg_array = array();
        preg_match('#</' . preg_quote($name, '#') . '\\s*>#im', $this->input, $reg_array, PREG_OFFSET_CAPTURE, $this->pos);
        $end_script = $reg_array ? ($reg_array[0][1]) : $this->input_length; //absolute end of script

        if ($this->pos < $end_script) { //get everything in between the script tags
            $content = substr($this->input, $this->pos, max($end_script-$this->pos, 0));
            $this->pos = $end_script;
        }

        return $content;
    }
4203
public function getFile(string $name)
    {
        return $this->fileContentAreas->where(function (FileContentArea $contentArea) use ($name) {
            return $contentArea->name === $name;
        })->first();
    }
1193897
public function getContentMeta($name = null)
    {
        if ($name) {
            if (isset($this->content_meta[$name])) {
                return $this->content_meta[$name];
            }

            return null;
        }

        return $this->content_meta;
    }
473613
protected function getAddressValue(string $email, string $name = null)
    {
        if ($name === null || $name == '') {
            return $email;
        } else {
            return "{$name} <{$email}>";
        }
    }
1350285
public function getSource($name)
    {
        /** @var TemplateDocument $doc */
        $doc = $this->getDocument($name);
        if (is_null($doc) || !($doc instanceof TemplateDocument))
        {
            throw new Twig_Error_Loader(sprintf('Template "%s" does not exist.', $name));
        }
        $content = $doc->getContent();
        return $content;
    }
1128003
public function get(string $name): string {
        if (!isset($this->get[$name])) {
            return "";
        }
        return $this->get[$name];
    }
852927
public static function get( $name = '' ) {
		$name = self::sanitize( $name );
		$filename = self::get_filename( $name );

		return $filename ? @file_get_contents( $filename ) : '';
	}
1234747
public function getHtml($name = null)
    {
        $host = self::API_SERVER;

        $langOption = '';

        if (isset($this->options['lang']) && ! empty($this->options['lang'])) {
            $langOption = "?hl={$this->options['lang']}";
        }

        $return = <<<HTML
<script type="text/javascript" src="{$host}{$langOption}" async defer></script>
HTML;

        return $return;
    }
515990
public function get($name, $default = null)
    {
        $filename = $this->getCacheFileName($name);
        if (!is_file($filename)) {
            return $default;
        }

        $content      = $this->getContent($name);
        $this->expire = null;

        if ($content !== false) {
            $expire = (int) substr($content, 8, 12);

            if (0 != $expire && time() > filemtime($filename) + $expire) {
                $this->unlink($filename);

                return $default;
            }

            $this->expire = $expire;
            $content      = substr($content, 32);

            // If data compression is enable
            if ($this->options['data_compress'] && function_exists('gzcompress')) {
                $content = gzuncompress($content);
            }

            return $this->unPackData($content);
        } else {
            return $default;
        }
    }
116666
public function getPost(string $name) : ?string
    {
        $r = null;
        if ($this->contentType === "multipart/form-data" ||
            $this->contentType === "application/x-www-form-urlencoded") {
            $r = ((isset($this->parsedBody[$name]) === true) ? (string)$this->parsedBody[$name] : null);
        }
        return $r;
    }
949972
public function getFile(string $name)
    {
        $contentArea = $this->content->getFile($name);

        if ($contentArea) {
            return $contentArea->file;
        }

        return null;
    }
233723
public function hasText(string $name) : bool
    {
        return $this->textContentAreas->any(function (TextContentArea $contentArea) use ($name) {
            return $contentArea->name === $name;
        });
    }