本文整理汇总了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'];