This is the URI: /search/index?keyword=value
Using nginx as my server.
Phalcon version: 2.0.9
This is my router for that URI:
$di->set('router', function () {
$router = new Router();
$router->setUriSource(Router::URI_SOURCE_SERVER_REQUEST_URI);
$router->setDefaultModule('front');
$router->removeExtraSlashes(true);
// START FRONT SEARCH ROUTE
$router->add(
'/search/index',
[
'controller' => 'search',
'action' => 'index',
]
);
return $router;
);
And my SearchController.php:
class SearchController extends ControllerBase
{
public function indexAction()
{
$this->view->disable();
var_dump($this->dispatcher->getParam('keyword')); # shows NULL
var_dump($this->dispatcher->getParams()); # shows empty Array
var_dump($this->request->getQuery('keyword')); # shows NULL
var_dump($this->request->getQuery()); #shows empty Array
var_dump($this->request->get()); # shows empty Array
var_dump($_SERVER['REQUEST_URI']); # shows: /search/index?keyword=value
var_dump($this->router->getRewriteUri()); # shows: /search/index
var_dump($_GET); # shows empty Array
}
}
So, anyone knows how to get that $_GET['keyword']? Seems I am out of the ideas.