本文整理汇总了PHP中Parser::setOutputType方法的典型用法代码示例。如果您正苦于以下问题:PHP Parser::setOutputType方法的具体用法?PHP Parser::setOutputType怎么用?PHP Parser::setOutputType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Parser
的用法示例。
在下文中一共展示了Parser::setOutputType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderImage
protected function renderImage($filename, $orientation = self::RIGHT)
{
$parser = new Parser();
$parser->setOutputType(OT_HTML);
$parserOptions = new ParserOptions();
$fakeTitle = new FakeTitle('');
return $parser->parse($this->getWikiText($filename, $orientation), $fakeTitle, $parserOptions, false)->getText();
}
示例2: parseText
public static function parseText($text = "")
{
global $wgTitle;
$tmpParser = new Parser();
$tmpParser->setOutputType(OT_HTML);
$tmpParserOptions = new ParserOptions();
return $tmpParser->parse($text, $wgTitle, $tmpParserOptions)->getText();
}
示例3: parseArticle
/**
* easy parse of article text
*
* @author Tomasz Odrobny
* @access private
*
*/
public static function parseArticle(&$qArticle, $text = null)
{
$articleText = $qArticle->getRawText();
if ($text != null) {
$articleText = $text;
}
$title = $qArticle->getTitle();
$tmpParser = new Parser();
$tmpParser->setOutputType(OT_HTML);
$tmpParserOptions = new ParserOptions();
$html = $tmpParser->parse($articleText, $title, $tmpParserOptions)->getText();
return $html;
}
示例4: sortAndMakeTickets
/**
*
* Sort tickets in order that should be displayed on target page and prepare html
* @param array $ticketsArray - array with
*/
private function sortAndMakeTickets(array $ticketsArray)
{
//$addCommentClass = false ) {
global $wgTitle;
$fogbugzTicketsHtmlReady = array();
$splitedResults = array();
$res = array();
$mainList = array();
$index = -1;
$isDone = false;
while ($isDone == false && $index < count($ticketsArray)) {
++$index;
for ($i = 0; $i < $index; $i++) {
if (!empty($ticketsArray[$index]) && !($ticketsArray[$i]['ixBug'] != $ticketsArray[$index]['ixBugParent'])) {
$isDone = true;
}
}
}
// we have prepared list of cases from page (main cases that has been written as tags)
for ($i = 0; $i < $index; $i++) {
$mainList[] = new FogbugzContainer($ticketsArray[$i]);
$mainList[$i]->addChildren($ticketsArray);
$mainList[$i]->prioritySort();
$mainList[$i]->prepareHtml($res, $i);
}
$tmpParser = new Parser();
$tmpParser->setOutputType(OT_HTML);
$tmpParserOptions = new ParserOptions();
$parsedResults = array();
//return $res;
//TODO: create templating system
for ($i = 0; $i < count($res); $i++) {
$fullInfo = implode("", $res[$i]);
$parsedResults[$i] = $tmpParser->parse($fullInfo, $wgTitle, $tmpParserOptions)->getText();
}
return $parsedResults;
}