本文整理汇总了PHP中ApiFormatBase::initPrinter方法的典型用法代码示例。如果您正苦于以下问题:PHP ApiFormatBase::initPrinter方法的具体用法?PHP ApiFormatBase::initPrinter怎么用?PHP ApiFormatBase::initPrinter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ApiFormatBase
的用法示例。
在下文中一共展示了ApiFormatBase::initPrinter方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initPrinter
public function initPrinter($unused = false)
{
$data = $this->getResult()->getResultData();
if (isset($data['error'])) {
$this->errorFallback->initPrinter($unused);
} else {
parent::initPrinter($unused);
}
}
示例2: initPrinter
public function initPrinter($unused = false)
{
$data = $this->getResult()->getResultData();
if (isset($data['error'])) {
$this->errorFallback->initPrinter($unused);
if ($this->mFailWithHTTPError) {
$this->getMain()->getRequest()->response()->statusHeader(400);
}
} else {
parent::initPrinter($unused);
}
}
示例3: initPrinter
/**
* This class expects the result data to be in a custom format set by self::setResult()
* $result['_feed'] - an instance of one of the $wgFeedClasses classes
* $result['_feeditems'] - an array of FeedItem instances
*/
public function initPrinter($unused = false)
{
parent::initPrinter($unused);
if ($this->isDisabled()) {
return;
}
$data = $this->getResult()->getResultData();
if (isset($data['_feed']) && isset($data['_feeditems'])) {
$data['_feed']->httpHeaders();
} else {
// Error has occurred, print something useful
ApiBase::dieDebug(__METHOD__, 'Invalid feed class/item');
}
}