本文整理汇总了PHP中bx_replace_markers函数的典型用法代码示例。如果您正苦于以下问题:PHP bx_replace_markers函数的具体用法?PHP bx_replace_markers怎么用?PHP bx_replace_markers使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bx_replace_markers函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _replaceMarkers
/**
* Replace provided markers in string.
* @param $s - string to replace markers in
* @param $a - markers array
* @return string with replaces markers
*/
protected function _replaceMarkers($mixed, $aMarkers)
{
if (empty($mixed) || empty($aMarkers) || !is_array($aMarkers)) {
return $mixed;
}
return bx_replace_markers($mixed, $aMarkers);
}
示例2: callSerialized
/**
* Perform serice call by accepting serialized array of service call parameters:
* @code
* array (
* 'module' => 'system', // module name
* 'method' => 'test', // service method name
* 'params' => array(), // array of parameters to pass to service method
* 'class' => 'Module', // class to search service method in
* )
* @endcode
*
* @param $s serialized array of serice call
* @param $aMarkers service method name in format 'method_name', corresponding class metod is serviceMethodName
* @param $sReplaceIn params to pass to service method
* @return service call result
*/
public static function callSerialized($s, $aMarkers = array(), $sReplaceIn = 'params')
{
$a = @unserialize($s);
if (false === $a || !is_array($a)) {
return '';
}
if (isset($a[$sReplaceIn])) {
$a[$sReplaceIn] = bx_replace_markers($a[$sReplaceIn], $aMarkers);
}
return self::call($a['module'], $a['method'], isset($a['params']) ? $a['params'] : array(), isset($a['class']) ? $a['class'] : 'Module');
}
示例3: getFeed
public function getFeed($mixedId, $iUserId = 0)
{
$sUrl = $this->getUrl($mixedId);
$aMarkers = array('SiteUrl' => BX_DOL_URL_ROOT);
if ($iUserId) {
$oProfile = BxDolProfile::getInstance($iUserId);
if (!$oProfile) {
$oProfile = BxDolProfileUndefined::getInstance();
}
$aMarkers['NickName'] = $oProfile->getDisplayName();
}
$sUrl = bx_replace_markers($sUrl, $aMarkers);
header('Content-Type: text/xml; charset=utf-8');
return bx_file_get_contents($sUrl . (defined('BX_PROFILER') && BX_PROFILER && 0 == strncmp(BX_DOL_URL_ROOT, $sUrl, strlen(BX_DOL_URL_ROOT)) ? '&bx_profiler_disable=1' : ''));
}
示例4: _replaceMarkers
/**
* Replace provided markers in a string
* @param $mixed string or array to replace markers in
* @return string where all occured markers are replaced
*/
protected function _replaceMarkers($mixed)
{
return bx_replace_markers($mixed, $this->_aMarkers);
}
示例5: _replaceMarkers
/**
* Replace provided markers string.
* @param $s - string to replace markers in
* @param $a - markers array
* @return string with replaces markers
*/
protected function _replaceMarkers($s, $a)
{
if (empty($s) || empty($a) || !is_array($a)) {
return $s;
}
return bx_replace_markers($s, $a);
}
示例6: getRssHelpUrl
public function getRssHelpUrl()
{
return bx_replace_markers($this->sPageRssHelpUrl, $this->aMarkers);
}
示例7: bx_replace_markers
function bx_replace_markers($mixed, $aMarkers)
{
if (empty($aMarkers)) {
return $mixed;
}
if (is_array($mixed)) {
foreach ($mixed as $sKey => $sValue) {
$mixed[$sKey] = bx_replace_markers($sValue, $aMarkers);
}
} else {
foreach ($aMarkers as $sKey => $sValue) {
$mixed = str_replace('{' . $sKey . '}', $sValue, $mixed);
}
}
return $mixed;
}
示例8: _replaceMarkers
/**
* Replace provided markers in menu item array, curently markers are replaced in title, link and onclick fields.
* @param $a menu item array
* @return array where markes are replaced with real values
*/
protected function _replaceMarkers($a)
{
if (empty($this->_aMarkers)) {
return $a;
}
$aReplacebleFields = array('title', 'link', 'onclick');
foreach ($aReplacebleFields as $sField) {
if (isset($a[$sField])) {
$a[$sField] = bx_replace_markers($a[$sField], $this->_aMarkers);
}
}
return $a;
}
示例9: _replaceMarkers
/**
* Replace provided markers in form array
* @param $a form description array
* @return array where markes are replaced with real values
*/
protected function _replaceMarkers()
{
$this->_aOptions['source'] = bx_replace_markers($this->_aOptions['source'], $this->_aMarkers);
}