本文整理汇总了PHP中Magento\Framework\Escaper::escapeUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP Escaper::escapeUrl方法的具体用法?PHP Escaper::escapeUrl怎么用?PHP Escaper::escapeUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Framework\Escaper
的用法示例。
在下文中一共展示了Escaper::escapeUrl方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSectionData
/**
* {@inheritdoc}
*/
public function getSectionData()
{
$customerId = $this->currentCustomer->getCustomerId();
if ($this->paypalData->shouldAskToCreateBillingAgreement($this->config, $customerId)) {
return ['askToCreate' => true, 'confirmUrl' => $this->escaper->escapeUrl($this->urlBuilder->getUrl($this->startAction, [\Magento\Paypal\Model\Express\Checkout::PAYMENT_INFO_TRANSPORT_BILLING_AGREEMENT => 1])), 'confirmMessage' => $this->escaper->escapeJsQuote(__('Would you like to sign a billing agreement to streamline further purchases with PayPal?'))];
}
return [];
}
示例2: getWidgetDeclaration
/**
* Return widget presentation code in WYSIWYG editor
*
* @param string $type Widget Type
* @param array $params Pre-configured Widget Params
* @param bool $asIs Return result as widget directive(true) or as placeholder image(false)
* @return string Widget directive ready to parse
* @api
*/
public function getWidgetDeclaration($type, $params = [], $asIs = true)
{
$directive = '{{widget type="' . $type . '"';
foreach ($params as $name => $value) {
// Retrieve default option value if pre-configured
if ($name == 'conditions') {
$name = 'conditions_encoded';
$value = $this->conditionsHelper->encode($value);
} elseif (is_array($value)) {
$value = implode(',', $value);
} elseif (trim($value) == '') {
$widget = $this->getConfigAsObject($type);
$parameters = $widget->getParameters();
if (isset($parameters[$name]) && is_object($parameters[$name])) {
$value = $parameters[$name]->getValue();
}
}
if ($value) {
$directive .= sprintf(' %s="%s"', $name, $value);
}
}
$directive .= '}}';
if ($asIs) {
return $directive;
}
$html = sprintf('<img id="%s" src="%s" title="%s">', $this->idEncode($directive), $this->getPlaceholderImageUrl($type), $this->escaper->escapeUrl($directive));
return $html;
}
示例3: escapeUrl
/**
* Escape html entities in url
*
* @param string $data
* @return string
*/
public function escapeUrl($data)
{
return $this->_escaper->escapeUrl($data);
}