Method getParam() does not exist

Hi,

I’m new to CakePHP 3.3 and I get into a problem trying to replicate the Bookmarker Quick Start tutorial and I just can’t figure what’s wrong. I Googled for the solution and searched on this forum without success as you can tell :wink:

Any help to get me going would be appreciated.

public function tags()
{
// The ‘pass’ key is provided by CakePHP and contains all
// the passed URL path segments in the request.
$tags = $this->request->getParam(‘pass’);
// Use the BookmarksTable to find tagged bookmarks.
$bookmarks = $this->Bookmarks->find(‘tagged’, [
‘tags’ => $tags
]);
// Pass variables into the view template context.
$this->set([
‘bookmarks’ => $bookmarks,
‘tags’ => $tags
]);
}

I believe getParam() is only available in CakePHP 3.4+.
For 3.3 and below you can simply use “params”, i.e. $this->request->params[‘pass’]

1 Like