本文整理匯總了PHP中Frontend::addToUrl方法的典型用法代碼示例。如果您正苦於以下問題:PHP Frontend::addToUrl方法的具體用法?PHP Frontend::addToUrl怎麽用?PHP Frontend::addToUrl使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Frontend
的用法示例。
在下文中一共展示了Frontend::addToUrl方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: create
/**
* Create the request url.
*
* It combines the params and creates an hash for it.
*
* @param int $dataId The data object id.
* @param string|null $type Object type. If empty it assumes a layer.
* @param string|null $format Data format. If empty it assumes geojson.
* @param Filter $filter Optional filter.
*
* @return RequestUrl
*/
public static function create($dataId, $type = null, $format = null, Filter $filter = null)
{
$params = array('for' => static::$for, 'type' => $type != 'layer' ? $type : null, 'id' => $dataId, 'format' => $format != 'geojson' ? $format : null);
$hash = base64_encode(implode(',', $params));
$query = 'leaflet=' . $hash;
if ($filter) {
$query .= '&f=' . $filter->getName() . '&v=' . $filter->toRequest();
}
$url = \Config::get('websitePath') . '/' . \Frontend::addToUrl($query, false);
return new static($url, $hash, $filter);
}
示例2: addToUrl
/**
* Point to `Frontend::addToUrl()` in front end templates (see #6736)
*
* @param string $strRequest The request string to be added
* @param boolean $blnIgnoreParams If true, the $_GET parameters will be ignored
* @param array $arrUnset An optional array of keys to unset
*
* @return string The new URI string
*/
public static function addToUrl($strRequest, $blnIgnoreParams = false, $arrUnset = array())
{
return \Frontend::addToUrl($strRequest, $blnIgnoreParams, $arrUnset);
}
示例3: handleAddToUrl
/**
* Add some suffix to the current URL.
*
* @param AddToUrlEvent $event The event.
*
* @return void
*/
public static function handleAddToUrl(AddToUrlEvent $event)
{
$event->setUrl(\Frontend::addToUrl($event->getSuffix(), $event->isIgnoreParams()));
}