php - Mage_Paypal_Block_Express_Shortcut 中的 getShortcutHtmlId() 在哪里?

标签 php magento paypal

Mage_Paypal_Block_Express_Shortcut 中的 getShortcutHtmlId() 在哪里?

<?php
/**
 * @var $this Mage_Paypal_Block_Express_Shortcut
 */
?>
<div class="paypal-logo">
<?php $shortcutHtmlId = $this->getShortcutHtmlId() ?>

在 mage 源代码中找不到 $this->getShortcutHtmlId()。有人知道这个函数在哪里声明吗? http://docs.magentocommerce.com/Mage_Paypal/Mage_Paypal_Block_Express_Shortcut.html

最佳答案

猎人,

这不是 Magento 中定义的方法,而是 Magento 中广泛使用的 getter 和 setter 方法。

在上面的例子中,这个值是在 Mage_Paypal_Block_Express_Shortcut108 行中设置的,如下所示:

    // set misc data
    $this->setShortcutHtmlId($this->helper('core')->uniqHash('ec_shortcut_'))
        ->setCheckoutUrl($this->getUrl($this->_startAction))
    ;

然后通过在 Controller 中调用 getShortcutHtmlId() 来接收它。

希望这能消除您的疑虑。

关于php - Mage_Paypal_Block_Express_Shortcut 中的 getShortcutHtmlId() 在哪里?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20482122/

相关文章:

php - WordPress重力表单通过标签名称获取字段ID

javascript - 订单/交易/充电方连接

php - 如何从外部站点将带有 curl 的 POST 数据发送到 magento Controller 功能?

python - 错误 : [Errno 32] Broken pipe when paypal calls back to python django app

angularjs - Angular 应用程序的 PayPal 快速结帐?

php - 没有显示带有 header ('Content-type: image/png' 的图像)

php - 如何通过php按修改日期对文件进行排序

php - 取消运输并重新计算 magento 中的总数

php - Magento2 管理员 404

paypal - 在本地主机上运行的网站上使用 Paypal IPN