本文整理匯總了PHP中WebUtils::httpRequestAppAPI方法的典型用法代碼示例。如果您正苦於以下問題:PHP WebUtils::httpRequestAppAPI方法的具體用法?PHP WebUtils::httpRequestAppAPI怎麽用?PHP WebUtils::httpRequestAppAPI使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WebUtils
的用法示例。
在下文中一共展示了WebUtils::httpRequestAppAPI方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: filterComponent
public static function filterComponent($component)
{
$tempComponent = $component;
// 臨時處理
if ($component['type'] == AppbymeUIDiyModel::COMPONENT_TYPE_FORUMLIST) {
$tempComponent['extParams']['forumId'] = 0;
}
$tempComponent['style'] = self::_filterStyle($component['style']);
$tempComponent['extParams']['subListStyle'] = self::_filterStyle($component['extParams']['subListStyle']);
$tempComponent['extParams']['subDetailViewStyle'] = self::_filterStyle($component['extParams']['subDetailViewStyle']);
// 轉換componentList結構
$tempComponentList = array();
if ($tempComponent['style'] == AppbymeUIDiyModel::COMPONENT_STYLE_LAYOUT_NEWS_AUTO && count($tempComponent['componentList']) > 0 && $tempComponent['componentList'][0]['type'] == AppbymeUIDiyModel::COMPONENT_TYPE_NEWSLIST) {
$newslist = WebUtils::httpRequestAppAPI('portal/newslist', array('moduleId' => $tempComponent['componentList'][0]['extParams']['newsModuleId']));
if ($newslist = WebUtils::jsonDecode($newslist)) {
foreach ($newslist['list'] as $key => $value) {
$tempParam = array('title' => $value['title'], 'desc' => $value['summary'], 'icon' => $value['pic_path']);
if ($value['source_type'] == 'topic') {
$tempParam = array_merge($tempParam, array('type' => AppbymeUIDiyModel::COMPONENT_TYPE_POSTLIST, 'extParams' => array('topicId' => $value['source_id'])));
} else {
if ($value['source_type'] == 'weblink') {
$tempParam = array_merge($tempParam, array('type' => AppbymeUIDiyModel::COMPONENT_TYPE_WEBAPP, 'extParams' => array('redirect' => $value['redirectUrl'])));
} else {
if ($value['source_type'] == 'news') {
$tempParam = array_merge($tempParam, array('type' => AppbymeUIDiyModel::COMPONENT_TYPE_NEWSVIEW, 'extParams' => array('articleId' => $value['source_id'])));
}
}
}
$tempComponentList[] = array_merge(AppbymeUIDiyModel::initComponent(), $tempParam);
}
}
} else {
foreach ($tempComponent['componentList'] as $subComponent) {
$tempComponentList[] = self::filterComponent($subComponent);
}
}
$tempComponent['componentList'] = $tempComponentList;
return $tempComponent;
}
示例2: run
public function run($tid, $act = 'apply')
{
$data = TopicUtils::getActivityInfo($tid);
$data = $data['action']['info'];
$errorMsg = '';
if (!empty($_POST)) {
// discuz 源碼會在mobile情況下把POST的數據轉碼成對應的charset,
// 由於這裏需要強製使用utf-8,且dz本身並沒有修改$_REQUEST變量
$_POST = array_intersect_key($_REQUEST, $_POST);
$requestData = WebUtils::jsonEncode($_POST, 'utf-8');
$res = WebUtils::httpRequestAppAPI('forum/topicactivity', array('tid' => $tid, 'act' => $act, 'json' => rawurlencode($requestData)));
if (($res = WebUtils::jsonDecode($res)) != false && $res['head']['errCode'] == MOBCENT_ERROR_NONE) {
$this->getController()->redirect(WebUtils::createUrl_oldVersion('index/returnmobileview'));
}
if ($res != false) {
$errorMsg = $res['head']['errInfo'];
}
}
// render
$viewFile = 'topicActivity';
$this->getController()->renderPartial($viewFile, array('data' => $data, 'errorMsg' => $errorMsg, 'formUrl' => WebUtils::createUrl_oldVersion('forum/topicactivityview', array('tid' => $tid, 'act' => $act))));
}
示例3: elseif
<a class="left carousel-control" href=".carousel-example-generic_one" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span>
</a>
<a class="right carousel-control" href=".carousel-example-generic_one" data-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span>
</a>
</div>
<?php
} elseif ($component['style'] == AppbymeUIDiyModel::COMPONENT_STYLE_LAYOUT_NEWS_AUTO) {
?>
<?php
foreach ($component['componentList'] as $key => $comp) {
?>
<?php
$newslist = WebUtils::httpRequestAppAPI('portal/newslist', array('moduleId' => $component['componentList'][0]['extParams']['newsModuleId'], 'hacker_uid' => 1));
$newslist = WebUtils::jsonDecode($newslist);
?>
<?php
foreach ($newslist['list'] as $list) {
?>
<div class="newsauto-component-item">
<div class="pull-left">
<img src="<?php
echo str_replace('xgsize', 'mobcentSmallPreview', $list['pic_path']);
?>
" style="width:50px;height:50px" class="img-rounded">
</div>
<div class="pull-left text-left page-main">
<div class="page-title"><strong><?php
echo $list['title'];