<?php
/**
 * Pi Engine (http://piengine.org)
 *
 * @link            http://code.piengine.org for the Pi Engine source repository
 * @copyright       Copyright (c) Pi Engine http://piengine.org
 * @license         http://piengine.org/license.txt BSD 3-Clause License
 * @package         View
 */

namespace Pi\View\Helper;

use Laminas\View\Helper\Escaper;

/**
 * Helper for escape HTML content, alias to escapeHtml
 *
 * Usage inside a phtml template
 *
 * ```
 *  $this->escape($content);
 *
 *  // With syntactic sugar
 *  _escape($content);
 * ```
 *
 * @author Taiwen Jiang <taiwenjiang@tsinghua.org.cn>
 */
class Escape extends Escaper\AbstractHelper
{
    /**
     * Escape a value for current escaping strategy
     *
     * @param string $value
     *
     * @return string
     */
    protected function escape($value)
    {
        return $this->getEscaper()->escapeHtml($value);
    }
}
