Swoole\Controller::display PHP Method

display() public method

render template file, then display it.
public display ( string $tpl_file = '' )
$tpl_file string
    function display($tpl_file = '')
    {
        if (empty($tpl_file)) {
            $tpl_file = strtolower($this->swoole->env['mvc']['controller']) . '/' . strtolower($this->swoole->env['mvc']['view']) . '.php';
        }
        if (!is_file($this->template_dir . $tpl_file)) {
            Error::info('template error', "template file[" . $this->template_dir . $tpl_file . "] not found");
        }
        extract($this->tpl_var);
        include $this->template_dir . $tpl_file;
    }