public function getTemplateVars() { $templateVars = get_object_vars($this); unset($templateVars['twig']); $templateVars['context'] = sgContext::getInstance(); $templateVars['request'] = array('uri' => $_SERVER['REQUEST_URI'], 'method' => $_SERVER['REQUEST_METHOD'], 'ajax' => sgContext::isAjaxRequest(), 'vars' => array('GET' => $_GET, 'POST' => $_POST)); return $templateVars; }
public function getTemplateVars() { $templateVars = get_object_vars($this); $templateVars['context'] = sgContext::getInstance(); $templateVars['configuration'] = sgConfiguration::getInstance(); $templateVars['request'] = array('uri' => $_SERVER['REQUEST_URI'], 'method' => $_SERVER['REQUEST_METHOD'], 'ajax' => sgContext::isAjaxRequest(), 'vars' => array('GET' => $_GET, 'POST' => $_POST)); $templateVars['js_settings'] = json_encode($this->js_settings); //str_replace() needed for incorrect slash escaping in php 5.2 $js_settings = str_replace('\\/', '/', json_encode($this->js_settings)); $templateVars['js_settings'] = <<<END <script type="text/javascript" charset="utf-8"> <!--//--><![CDATA[//><!-- superglue = new Object(); superglue.settings = {$js_settings}; //--><!]]> </script> END; return $templateVars; }