<?php

namespace Velis\Mvc\View\Helper;

use Velis\App;

/**
 * CSRF token generator
 * @author Olek Procki <olo@velis.pl>
 */
class CsrfToken
{
    /**
     * Returns token input field
     * @return string
     */
    public function __invoke($tokenField = 'csrf_token')
    {
        return '<input type="hidden"
                       name="' . $tokenField . '"
                       value="' . App::$session->csrfToken . '"
                />';
    }
}
