Magento中htmlEscape和escapeHtml函数有什么区别?

我刚刚更新了Magento网站,我看到基本模板文件中的一个变化是htmlEscape在整个过程中变成了escapeHtml。
这两个功能有什么区别吗?

答案可以在定义它的类中找到:app / code / core / Mage / Core / Block / Abstract.php

所以似乎在版本CE 1.4.0.0-rc1之后的一段时间他们决定htmlEscape应该重命名为escapeHtml

#File: app/code/core/Mage/Core/Block/Abstract.php
/**
 * @deprecated after 1.4.0.0-rc1
 * @see self::escapeHtml()
 */
public function htmlEscape($data, $allowedTags = null)
{
    return $this->escapeHtml($data, $allowedTags);
}

/**
 * Escape html entities
 *
 * @param   mixed $data
 * @param   array $allowedTags
 * @return  string
 */
public function escapeHtml($data, $allowedTags = null)
{
    return $this->helper('core')->escapeHtml($data, $allowedTags);
}

相关文章

0 0 投票数
文章评分
订阅评论
提醒
0 评论
内联反馈
查看所有评论