/** * Renders HTML from template * * @param array $customVariables */ private function renderHTML($customVariables = array()) { $twig = new \Twig_Environment(new \Twig_Loader_Filesystem(self::TEMPLATES_DIRECTORY)); $customPageTitle = $this->config->getMapPageTitle(); $pageTitle = array('GeoPal'); if (!empty($customPageTitle)) { array_unshift($pageTitle, $customPageTitle); } $this->mapPageHTML = $twig->loadTemplate(self::MAP_PAGE_TEMPLATE)->render($customVariables + array('googleMapsAPIKey' => $this->config->getGoogleMapsAPIKey(), 'pageTitle' => implode(' - ', $pageTitle))); }