當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Escaper::escapeJsQuote方法代碼示例

本文整理匯總了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 [];
 }
開發者ID:Doability,項目名稱:magento2dev,代碼行數:11,代碼來源:BillingAgreement.php

示例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;
 }
開發者ID:artmouse,項目名稱:Umc_Base,代碼行數:25,代碼來源:AbstractType.php

示例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);
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:11,代碼來源:AbstractBlock.php


注:本文中的Magento\Framework\Escaper::escapeJsQuote方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。