本文整理汇总了PHP中PHPWS_Text::useAnchor方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPWS_Text::useAnchor方法的具体用法?PHP PHPWS_Text::useAnchor怎么用?PHP PHPWS_Text::useAnchor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPWS_Text
的用法示例。
在下文中一共展示了PHPWS_Text::useAnchor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parseOutput
/**
* Prepares text for display
*
* Should be used after retrieving data from the database
*
* @author Matthew McNaney <mcnaney at gmail dot com>
* @param string text Text to parse
* @param boolean decode Whether entity_decoding should take place.
* @param boolean use_filters If true, any filters requested in the text_settings file will be
* run against the output text. (deprecated)
* @return string text Stripped text
*/
public static function parseOutput($text, $decode = ENCODE_PARSED_TEXT, $use_filters = false, $use_breaker = USE_BREAKER, $fix_anchors = FIX_ANCHORS)
{
$t = new PHPWS_Text();
$t->setText($text, $decode);
$t->useBreaker($use_breaker);
$t->useAnchor($fix_anchors);
$text = $t->getPrint();
$text = filter_var($text, FILTER_UNSAFE_RAW, FILTER_FLAG_STRIP_HIGH);
return $text;
}
示例2: getSummaryAndEntry
public function getSummaryAndEntry($fix_anchors = true)
{
if (!empty($this->entry)) {
$content = $this->summary . '<hr />' . $this->entry;
//return PHPWS_Text::parseOutput($this->summary) . '<hr />' . PHPWS_Text::parseOutput($this->entry);
} else {
$content = $this->summary;
//return PHPWS_Text::parseOutput($this->summary);
}
$text = new PHPWS_Text($content);
$text->useAnchor($fix_anchors);
return filter_var($text->getPrint(), FILTER_UNSAFE_RAW, FILTER_FLAG_STRIP_HIGH);
}