<?php
namespace controllers;

/**
 * Texy controller
 * @author Jérôme Brilland
 * @version 2.1
 * @copyright (c) 2018-2022, Jérôme Brilland
 * @license http://www.gnu.org/licenses/gpl.txt GNU General Public License
 */
class TexyController extends \ActionController {

    public function doPreview() {
        $data = $this->request->getParameters()->getString( 'data', '' );
        $texy = \IoC::resolve( 'texy' );
        $this->response->addHeader( 'Content-Type', 'text/plain' );
        $this->renderText( $texy->process( $data ) );
    }
}
