本文整理汇总了PHP中SFUtils::createFormLink方法的典型用法代码示例。如果您正苦于以下问题:PHP SFUtils::createFormLink方法的具体用法?PHP SFUtils::createFormLink怎么用?PHP SFUtils::createFormLink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SFUtils
的用法示例。
在下文中一共展示了SFUtils::createFormLink方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: formlink
/**
* @param Parser $parser
* @return mixed
*/
public static function formlink($parser)
{
$params = func_get_args();
array_shift($params);
// We don't need the parser.
$original = SFUtils::createFormLink($parser, $params, 'formlink');
if (strpos($original, 'class="new"') !== false) {
$original = str_replace('class="new"', 'class="btn btn-primary pull-right"', $original);
} else {
$original = str_replace('href=', 'class="btn btn-primary pull-right" href=', $original);
}
$original = str_replace('self">', 'self"><i class="fa fa-edit"></i> ', $original);
return $parser->insertStripItem($original);
}
示例2: renderSeriesLink
/**
* Renders the #serieslink parser function.
*
* @param Parser $parser
* @return string the unique tag which must be inserted into the stripped text
*/
public static function renderSeriesLink(&$parser)
{
global $wgTitle;
$params = func_get_args();
array_shift($params);
// We don't need the parser.
// remove the target parameter should it be present
foreach ($params as $key => $value) {
$elements = explode('=', $value, 2);
if ($elements[0] === 'target') {
unset($params[$key]);
}
}
// set the origin parameter
// This will block it from use as iterator parameter. Oh well.
$params[] = "origin=" . $parser->getTitle()->getArticleId();
// hack to remove newline from beginning of output, thanks to
// http://jimbojw.com/wiki/index.php?title=Raw_HTML_Output_from_a_MediaWiki_Parser_Function
return $parser->insertStripItem(SFUtils::createFormLink($parser, 'SeriesEdit', $params), $parser->mStripState);
}
示例3: renderQueryFormLink
static function renderQueryFormLink(&$parser)
{
$params = func_get_args();
array_shift($params);
// We don't need the parser.
// hack to remove newline from beginning of output, thanks to
// http://jimbojw.com/wiki/index.php?title=Raw_HTML_Output_from_a_MediaWiki_Parser_Function
return $parser->insertStripItem(SFUtils::createFormLink($parser, $params, 'queryformlink'), $parser->mStripState);
}
示例4: renderQueryFormLink
static function renderQueryFormLink(&$parser)
{
$params = func_get_args();
array_shift($params);
// We don't need the parser.
// If it's a popup, make this just a static display of
// results, with no 'additiona query' form, since at the
// moment additional queries can't be handled anyway.
if (in_array('popup', $params)) {
$params[] = 'wpRunQuery=true';
$params[] = 'additionalquery=false';
}
// hack to remove newline from beginning of output, thanks to
// http://jimbojw.com/wiki/index.php?title=Raw_HTML_Output_from_a_MediaWiki_Parser_Function
return $parser->insertStripItem(SFUtils::createFormLink($parser, 'RunQuery', $params), $parser->mStripState);
}