protected function renderTemplate(\Twig_Environment $env, $templateName, $params, $addDivWithAndHeight = false) {
        $templ = false;
        if (isset($this->resources[$templateName])) {
            $templ = $env->loadTemplate($this->resources[$templateName]);
        } else {
            throw new \Exception('mmm, template not found');
        }
        if ($addDivWithAndHeight && isset($params['config']) && isset($params['config']['width']) && isset($params['config']['height'])) {
            $params['addDivWithAndHeight'] = true;
            $params['width'] = $params['config']['width'];
            $params['height'] = $params['config']['height'];
        } else {
            $params['addDivWithAndHeight'] = false;
        }

        return $templ->render($params);
    }
protected function renderTemplate(\Twig_Environment $env, $templateName, $params, $addDivWithAndHeight = false) {
        $templ = false;
        if (isset($this->resources[$templateName])) {
            $templ = $env->loadTemplate($this->resources[$templateName]);
        } else {
            throw new \Exception('mmm, template not found');
        }
        if ($addDivWithAndHeight && isset($params['config']) && isset($params['config']['width']) && isset($params['config']['height'])) {
            $params['addDivWithAndHeight'] = true;
            $params['width'] = $params['config']['width'];
            $params['height'] = $params['config']['height'];
        } else {
            $params['addDivWithAndHeight'] = false;
        }

        return $templ->render($params);
    }
protected function renderTemplate ( \ Twig_Environment $ env , $ templateName , $ params , $ addDivWithAndHeight = false ) { $ templ = false ; if ( isset ( $ this -> resources [ $ templateName ] ) ) { $ templ = $ env -> loadTemplate ( $ this -> resources [ $ templateName ] ) ; } else { throw new \ Exception ( 'mmm, template not found' ) ; } if ( $ addDivWithAndHeight && isset ( $ params [ 'config' ] ) && isset ( $ params [ 'config' ] [ 'width' ] ) && isset ( $ params [ 'config' ] [ 'height' ] ) ) { $ params [ 'addDivWithAndHeight' ] = true ; $ params [ 'width' ] = $ params [ 'config' ] [ 'width' ] ; $ params [ 'height' ] = $ params [ 'config' ] [ 'height' ] ; } else { $ params [ 'addDivWithAndHeight' ] = false ; } return $ templ -> render ( $ params ) ; }
generic method that generates a Twig template based on its name
generic method that generates a Twig template based on its name