Reputation:
I had this public function in ApplicationController
public function indexAction($bar) {
echo $bar;
return new ViewModel();
}
How I can pass this argument? I've tried http://localhost/zf2/public/application/index/index?bar=foo but this not works
Upvotes: 0
Views: 45
Reputation: 1222
Grab it from params controller plugin.
public function indexAction()
{
$bar = $this->params()->fromQuery('bar');
return new ViewModel();
}
Upvotes: 1