protected function main() { d('cp'); if ('onNewQuestion' === $this->eventName) { $Question = $this->obj; $oParser = SearchFactory::get($this->Registry); $oParser->getSimilarQuestions($Question); } }
/** * (non-PHPdoc) * @see Lampcms.WebPage::main() */ protected function main() { /** * Do NOT run urldecode() on request string * as it's already decoded because it uses * $_GET as underlying array, and php * already decodes $_GET or $_POST vars */ $this->term = $this->Registry->Request->getUTF8('q')->stripTags(); $this->aPageVars['qheader'] = '<h1>Search results for: ' . $this->term . '</h1>'; $this->aPageVars['title'] = 'Questions matching '' . $this->term . '''; d('$this->term: ' . $this->term); $this->Search = SearchFactory::get($this->Registry); $this->Search->search($this->term); $this->makeTopTabs()->makeInfo()->makeBody(); }
/** * (non-PHPdoc) * * @see Lampcms.WebPage::main() */ protected function main() { /** * Do NOT run urldecode() on request string * as it's already decoded because it uses * $_GET as underlying array, and php * already decodes $_GET or $_POST vars */ try { $term = $this->Registry->Router->getSegment(2); $this->term = Utf8String::stringFactory(\urldecode($term)); } catch (\Lampcms\Uri\SegmentNotFoundException $e) { $this->term = $this->Registry->Request->getUTF8('q'); } $this->safeTerm = \str_replace(array('<', '>'), array('<', '>'), $this->term->valueOf()); $this->aPageVars['qheader'] = '<h1>@@Search results for@@: ' . $this->safeTerm . '</h1>'; $this->aPageVars['title'] = '@@Questions matching@@ '' . $this->safeTerm . '''; d('$this->term: ' . $this->term); $this->Search = SearchFactory::get($this->Registry); $this->Search->search($this->term); $this->makeTopTabs()->makeInfo()->makeBody(); }