original_string: 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);
      }
code: 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);
      }
code_tokens: 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 ) ; }
docstring: generic method that generates a Twig template based on its name
docstring_tokens: generic method that generates a Twig template based on its name