本文整理汇总了PHP中Parser::Parse方法的典型用法代码示例。如果您正苦于以下问题:PHP Parser::Parse方法的具体用法?PHP Parser::Parse怎么用?PHP Parser::Parse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Parser
的用法示例。
在下文中一共展示了Parser::Parse方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setStartColor
public function setStartColor($input)
{
$col = Parser::Parse($input)->toHSL();
$this->startHue = $col->hue;
$this->startSat = $col->saturation;
$this->lum = $col->luminance;
return $this;
}
示例2: renderFieldset
function renderFieldset($input, $argv, &$parser)
{
#global $wgOut;
# $argv is an array containing any arguments passed to the extension like <example argument="foo" bar>..
$localParser = new Parser();
$outputObj = $localParser->Parse($input, $parser->mTitle, $parser->mOptions);
$output = "<fieldset>\n";
if (!empty($argv['legend'])) {
$output .= "<legend><b>" . $argv['legend'] . "</b></legend>\n";
}
$output .= $outputObj->getText() . '</fieldset>';
return $output;
}
示例3: renderPaper
function renderPaper($input, $argv, &$parser)
{
# $argv is an array containing any arguments passed to the extension like <example argument="foo" bar>..
global $wgExtensionsPath;
$localParser = new Parser();
$outputObj = $localParser->Parse($input, $parser->mTitle, $parser->mOptions);
if (empty($argv['width']) == true) {
$width = "100%";
} else {
$width = $argv['width'];
}
if (empty($argv['align']) == true) {
$align = "left";
} else {
$align = $argv['align'];
}
$ext_dir = "{$wgExtensionsPath}/3rdparty/Paper/";
$output = '<table width="' . $width . '" align="' . $align . '" bgcolor="fbe7bd" style="border: 0px; margin: 0px; padding: 0px;" cellspacing=0>' . '<tr>' . '<td width=34 height=34 valign="top" style="background-image:url(' . $ext_dir . '/Paper_l.png); border: 0px; margin: 0px; padding: 0px;"><img src="' . $ext_dir . '/Paper_ol.png"></td>' . '<td style="background-image:url(' . $ext_dir . '/Paper_o.png); background-repeat:repeat-x; border: 0px; margin: 0px; padding: 0px;"></td>' . '<td width=34 height=34 valign="top" style="background-image:url(' . $ext_dir . '/Paper_r.png); border: 0px; margin: 0px; padding: 0px;"><img src="' . $ext_dir . '/Paper_or.png"></td>' . '</tr>' . '<tr>' . '<td style="background-image:url(' . $ext_dir . '/Paper_l.png); background-repeat:repeat-y; border: 0px; margin: 0px; padding: 0px;"> </td>' . '<td style="border: 0px; margin: 0px; padding: 0px; background-color:#FBE7BD;" bgcolor="#fbe7bd">' . $outputObj->getText() . '</td>' . '<td style="background-image:url(' . $ext_dir . '/Paper_r.png); border: 0px; margin: 0px; padding: 0px; border: 0px; margin: 0px; padding: 0px;"></td>' . '</tr>' . '<tr>' . '<td width=34 height=34 valign="top" style="background-image:url(' . $ext_dir . '/Paper_l.png); border: 0px; margin: 0px; padding: 0px;"><img src="' . $ext_dir . '/Paper_ul.png"></td>' . '<td style="background-image:url(' . $ext_dir . '/Paper_u.png); background-repeat:repeat-x; border: 0px; margin: 0px; padding: 0px;"></td>' . '<td width=34 height=34 valign="top" style="background-image:url(' . $ext_dir . '/Paper_r.png); border: 0px; margin: 0px; padding: 0px;"><img src="' . $ext_dir . '/Paper_ur.png"></td>' . '</tr>' . '</table>';
return $output;
}
示例4: run
function run(&$xml_reponse, $p)
{
$clientid = $p["clientid"];
$param = $p["param"];
$sender = $p["sender"];
$recipient = $p["recipient"];
$recipientid = $p["recipientid"];
$c =& pfcGlobalConfig::Instance();
$u =& pfcUserConfig::Instance();
$ct =& pfcContainer::Instance();
$nick = $u->getNickname();
$text_src = phpFreeChat::PreFilterMsg(trim($param));
$text_src = str_replace(" ", "", $text_src);
try {
$p = new Parser($text_src);
$p->setDebug($ct, $nick, $recipient);
$ov = $p->Parse();
$text = $nick . " : " . $text_src . " >> " . $ov->str . " = " . $ov->val;
} catch (Exception $e) {
$text = "Error: " . $e->getMessage();
}
$ct->write($recipient, $nick, "send", $text);
}
示例5: Parser
<?php
set_time_limit(0);
error_reporting(E_ALL);
require_once "Parser.php";
$parser = new Parser();
$p = $parser->GetBrands();
if (isset($_POST['start_submit'])) {
foreach ($_POST['brand'] as $brand_id) {
foreach ($_POST['rasdel'] as $rasdel_id) {
$parser->Parse($brand_id, $rasdel_id);
}
}
echo "Writing to result.xls<br>\n";
$parser->WriteToXLS("result.xls");
echo "Результат <a href=\"result.xls\">скачать</a>";
exit;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1251"/>
<title>Парсер ferio.ru</title>
<link rel="stylesheet" href="bootstrap.css"/>
<style>
.content{margin: 0 auto;width: 400px;}
.content label{
float:none;
display: block;