发送文本消息
@param string $content
@param array $atMobiles
@param bool $isAtAll
@return mixed
434858
public function sendTextMsg($content, array $atMobiles = [], $isAtAll = false)
    {
        $query = [
            'msgtype' => 'text',
            'text' => [
                'content' => $content,
            ],
            'at' => [
                'isAtAll' => $isAtAll
            ],
        ];
        if (is_array($atMobiles) && count($atMobiles)>0) {
            $query['at']['atMobiles'] = $atMobiles;
        }
        return $this->sendMsg($query);
    }
125670
public function sendSms($to, $content = null, $tempId = null, array $data = [], array $params = [])
    {
        $this->reset();
        $this->params($params, true);
        $to = $this->formatMobile(Util::formatMobiles($to));

        if ($tempId && $this instanceof TemplateSms) {
            $this->sendTemplateSms($to, $tempId, $data);
        } elseif ($content && $this instanceof ContentSms) {
            $this->sendContentSms($to, $content);
        }
    }
1358055
public static function toRoute(string $name, string $text, $parameters = [], $absolute = true)
    {
        return static::to(route($name, $parameters, $absolute), $text);
    }
1184707
private function writeToFiles(
        array $content,
        string $baseDir,
        ConfigCache $dump,
        SymfonyBuilder $container
    ): void {
        $rootCode = array_pop($content);
        assert(is_string($rootCode));

        $filesystem = new Filesystem();

        foreach ($content as $file => $code) {
            $filesystem->dumpFile($baseDir . $file, $code);
        }

        $dump->write($rootCode, $container->getResources());
    }
438962
public static function script(
        string $content, 
        array $attributes = ["type" => "text/javascript"],
        bool $addCdataTag = true
    ) : string
    {
        if ($addCdataTag) {
            $content = "\n//<![CDATA[\n" . $content ."\n//]]>\n";
        }
        return self::tag("script", $content, $attributes);
    }
392387
protected static function addAsseticBundle( &$content )
	{
		if( preg_match( "/    bundles:[ ]*\[.*'AimeosShopBundle'.*\]/", $content ) !== 1 )
		{
			$search = array( "/    bundles:[ ]*\[([^\]]+)\]/", "/    bundles:[ ]*\[([ ]*)\]/" );
			$replace = array( "    bundles: [$1,'AimeosShopBundle']", "    bundles: ['AimeosShopBundle']" );

			if( ( $content = preg_replace( $search, $replace, $content ) ) !== null ) {
				return true;
			}
		}

		return false;
	}
584896
public function visit(vfsStreamContent $content)
    {
        switch ($content->getType()) {
            case vfsStreamContent::TYPE_FILE:
                $this->visitFile($content);
                break;

            case vfsStreamContent::TYPE_DIR:
                $this->visitDirectory($content);
                break;

            default:
                throw new InvalidArgumentException('Unknown content type');
        }

        return $this;
    }
466537
public function import($content, $isfile = false, $passwords = array())
    {
        try {
            // GnuPG 2.1 requires secret key passphrases on import
            foreach ($passwords as $keyid => $pass) {
                $this->gpg->addPassphrase($keyid, $pass);
            }

            if ($isfile)
                return $this->gpg->importKeyFile($content);
            else
                return $this->gpg->importKey($content);
        }
        catch (Exception $e) {
            return $this->get_error_from_exception($e);
        }
    }
126526
public function render(
        $content,
        array $attribs = [],
        ElementInterface $element = null,
        FormInterface $form = null
    ) {
        $legendHelper = $this->getLegendHelper();

        if ($legendHelper instanceof TranslatorAwareInterface) {
            $rollbackTextDomain = $legendHelper->getTranslatorTextDomain();
            $legendHelper->setTranslatorTextDomain($this->getTranslatorTextDomain());
        }

        $content = $legendHelper(
                $element,
                [],
                $element,
                $form
            ) . $content;

        if (isset($rollbackTextDomain)) {
            $legendHelper->setTranslatorTextDomain($rollbackTextDomain);
        }

        return parent::render($content, $attribs);
    }
1228546
public static function btn($href, $content, $attr = ['class' => 'btn btn-default'], $params = array('tag' => 'a', 'attrHref' => 'href'))
    {
        $params = Arr::mergeWithDefaultParams($params);

        if(preg_match('/^fa-/', $content)){
            $content = "<i class=\"fa ".$content.'"></i>';
        } elseif(preg_match('/^glyphicon-/', $content)){
            $content = "<i class=\"glyphicon ".$content.'"></i>';
        }

        return '<'.$params['tag'].' '.$params['attrHref'].'="'.$href.'" '. Html::attributes($attr) .'>'.$content.'</'.$params['tag'].'>';
    }
94787
public function getN2nLocaleSwitch(array $ulAttrs = null, array $liAttrs = null, array $aAttrs = null) {
		$urls = $this->meta->getN2nLocaleSwitchUrls();
		if (empty($urls)) {
			return null;
		}
		
		$n2nLocales = array();
		$langUsages = array();
		foreach (array_keys($urls) as $n2nLocaleId) {
			$n2nLocale = new N2nLocale($n2nLocaleId);
			$n2nLocales[$n2nLocaleId] = $n2nLocale;
			$langId = $n2nLocale->getLanguageId();
			if (!isset($langUsages[$langId])) $langUsages[$langId] = 1;
			else $langUsages[$langId]++;
		}
		
		$ul = new HtmlElement('ul', $ulAttrs);
		
		$html = $this->view->getHtmlBuilder();
		foreach ($urls as $n2nLocaleId => $navUrl) {
			$label = null;
			if ($langUsages[$n2nLocales[$n2nLocaleId]->getLanguageId()] > 1) {
				$label = $n2nLocales[$n2nLocaleId]->toPrettyId();
			} else {
				$label = mb_strtoupper($n2nLocales[$n2nLocaleId]->getLanguageId());
			}
			
			$elemLiAttrs = $liAttrs;
			if ($this->view->getN2nLocale()->equals($n2nLocales[$n2nLocaleId])) {
				$elemLiAttrs = HtmlUtils::mergeAttrs((array) $elemLiAttrs, array('class' => 'active'));
			}
			
			$ul->appendLn(new HtmlElement('li', $elemLiAttrs, $html->getLink($navUrl, $label, $aAttrs)));
		}
		
		return $ul;
	}
99194
public static function coreHTMLElement($element, $content, array $attrs = []) {

        $template = "<%element%%attributes%>%innerHTML%</%element%>";

        $attributes = trim(StringHelper::parseArray($attrs));
        if (0 < strlen($attributes)) {
            $attributes = " " . $attributes;
        }

        $innerHTML = null !== $content ? trim($content, " ") : "";

        return StringHelper::replace($template, ["%element%", "%attributes%", "%innerHTML%"], [trim($element), $attributes, $innerHTML]);
    }
765286
public function setContent(BlockStaticCollection $content)
    {
        if (count($content) > 0) {
            $this->content = $content;
        } else {
            $msg = "A HottextInteraction object must be composed of at least one BlockStatic object, none given.";
            throw new InvalidArgumentException($msg);
        }
    }
1337702
public function writeCachedContent(Smarty_Internal_Template $_template, $content)
    {
        if ($_template->smarty->ext->_writeFile->writeFile($_template->cached->filepath, $content, $_template->smarty) === true) {
            if (function_exists('opcache_invalidate')) {
                opcache_invalidate($_template->cached->filepath);
            }
            $cached = $_template->cached;
            $cached->timestamp = $cached->exists = is_file($cached->filepath);
            if ($cached->exists) {
                $cached->timestamp = filemtime($cached->filepath);
                return true;
            }
        }
        return false;
    }
488542
public static function build(
        $content,
        ExecutionInfos $infos,
        Request\AbstractRequest $request
    ) {
        $response = new Response($request);
        $response->setStatus($infos->status);
        $response->setTransactionTime($infos->transactionTime);
        $response->setExecutionInfos($infos);

        //Populate request headers with all really sent headers
        if (!empty($infos->headers)) {
            self::parseHeaders(
                $infos->headers,
                $request
            );
        }

        //Headers are returned with content, so we extract it
        $content = self::parseHeaders($content, $response);

        $response->setBody($content);

        return $response;
    }
791732
public function handle(?string $content = null, array $atts = []): string
    {
        if (is_null($this->callback)) {
            return (string) $content;
        }
        $callback = $this->callback->bindTo($this, $this);

        return $callback($content, $atts);
    }
148554
protected static function generateContentArray($contentRows, $keys, $generateHeader = true)
    {
        if (is_scalar($contentRows)) {
            throw new Exception("Content must be either an array, object or traversable");
        }

        $attributeKeys = $keys;
        $header = [];
        $rows = [];
        $i = 0;
        foreach ($contentRows as $content) {
            // handle rows content
            if (!empty($keys) && is_array($content)) {
                foreach ($content as $k => $v) {
                    if (!in_array($k, $keys)) {
                        unset($content[$k]);
                    }
                }
            } elseif (!empty($keys) && is_object($content)) {
                $attributeKeys[get_class($content)] = $keys;
            }
            $rows[$i] = ArrayHelper::toArray($content, $attributeKeys, false);

            // handler header
            if ($i == 0 && $generateHeader) {
                if ($content instanceof ActiveRecordInterface) {
                    foreach ($content as $k => $v) {
                        if (empty($keys)) {
                            $header[] = $content->getAttributeLabel($k);
                        } elseif (in_array($k, $keys)) {
                            $header[] = $content->getAttributeLabel($k);
                        }
                    }
                } else {
                    $header = array_keys($rows[0]);
                }
            }

            $i++;
        }

        if ($generateHeader) {
            return ArrayHelper::merge([$header], $rows);
        }

        return $rows;
    }