本文整理汇总了PHP中XString::fixHtmlText方法的典型用法代码示例。如果您正苦于以下问题:PHP XString::fixHtmlText方法的具体用法?PHP XString::fixHtmlText怎么用?PHP XString::fixHtmlText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XString
的用法示例。
在下文中一共展示了XString::fixHtmlText方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getInboxMsgListByUserId
/**
* @brief 根据用户id获取站内信列表
* @author whd
* @exampleUrl http://dev.mobile-api.haodf.com/patientapi/message_getinboxmsglistbyuserid?userId=613876396&type=all&pageId=1&pageSize=10&xdoc=1
*
* @Param $userId 用户id
* @Param $type (all,unread)
* @Param $pageId 当前页码
* @Param $pageSize 每页显示数
*
* @Returns array('id', 'title', 'isread', 'senderName', 'content', 'ctime')
*/
public function getInboxMsgListByUserId($userId, $type, $pageId, $pageSize)
{/*{{{*/
$user = DAL::get()->find('user', $userId);
if ($user->isNull())
{
$this->setErrorCode(107);
return 0;
}
$this->_initPageInfo($pageId, $pageSize);
$options = array();
$options['filterSourceType'] = Message::TYPE_PATIENTCLUB;
if ($type == 'unread')
{
$options['isread'] = 0;
}
if ($type == 'orderbyunread')
{
$options['orderby'] = 'isread';
}
$res = StationLetterClient::getInstance()->getMsgs($userId, Box::TYPE_INBOX, $pageId, $pageSize, $options);
$mailList = $res['msgInfos'];
$infos = array();
$senderIds = array();
foreach ($mailList as $mail)
{
if(empty($mail))
continue;
$info = array();
$info['id'] = $mail['id'];//boxmsgref->id
$info['title'] = strip_tags($mail['title']);
$info['isread'] = $mail['isread'];//状态
$info['senderName'] = $mail['senderId'];
$info['content'] = mb_substr(trim(XString::fixHtmlText(str_replace(' ', '', $mail['content']))), 0, 15, 'GBK');
$info['ctime'] = strtotime($mail['ctime']);
$infos[] = $info;
$senderIds[] = $mail['senderId'];
}
$userList = DAL::get()->find('User', $senderIds);
foreach($infos as $key => $info)
{
if ($userList[$info['senderName']]->isNull())
$infos[$key]['senderName'] = '身份不明';
else
$infos[$key]['senderName'] = $userList[$info['senderName']]->name;
}
$this->pageInfo = $res['pageInfo'];
$this->content = $infos;
}/*}}}*/