本文整理汇总了PHP中Magento\Framework\Escaper::escapeJsQuote方法的典型用法代码示例。如果您正苦于以下问题:PHP Escaper::escapeJsQuote方法的具体用法?PHP Escaper::escapeJsQuote怎么用?PHP Escaper::escapeJsQuote使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Framework\Escaper
的用法示例。
在下文中一共展示了Escaper::escapeJsQuote方法的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: getEditFormField
public function getEditFormField()
{
$lines = [];
$tab = $this->getPadding();
$eol = $this->getEol();
$lines[] = '$fieldset->addField(';
$lines[] = $tab . '\'' . $this->getAttribute()->getCode() . '\',';
$lines[] = $tab . '\'' . $this->getEditFormType() . '\',';
$lines[] = $tab . '[';
$lines[] = $tab . $tab . '\'name\' => \'' . $this->getAttribute()->getCode() . '\',';
$lines[] = $tab . $tab . '\'label\' => __(\'' . $this->getAttribute()->getLabel() . '\'),';
$lines[] = $tab . $tab . '\'title\' => __(\'' . $this->getAttribute()->getLabel() . '\'),';
if ($this->getAttribute()->getRequired()) {
$lines[] = $tab . $tab . '\'required\' => true,';
}
if ($note = $this->getAttribute()->getNote()) {
$lines[] = $tab . $tab . '\'note\' => __(\'' . $this->escaper->escapeJsQuote($note) . '\'),';
}
foreach ($this->getAdditionalEditFormOptions() as $option) {
$lines[] = $tab . $tab . $option;
}
$lines[] = $tab . ']';
$lines[] = ');';
return $tab . $tab . implode($eol . $tab . $tab, $lines) . $eol;
}
示例3: escapeJsQuote
/**
* Escape quotes in java scripts
*
* @param string|array $data
* @param string $quote
* @return string|array
*/
public function escapeJsQuote($data, $quote = '\'')
{
return $this->_escaper->escapeJsQuote($data, $quote);
}