user3661042
user3661042

Reputation: 167

CakePHP4 - How to use the 'RequestHandler' component within another component

The PHP code segment of my component is shown below:

...
class NewsletterFormComponent extends Component {

public $components = ['Flash','RequestHandler'];
public $controller;


public function beforeFilter()
{
$this->controller = $this->getController();
}

public function registration($data = null) {
...
if ($this->request->is('post')) {
//do something
}
...
}
...

The following error is displayed:
Call to a member function is() on null
How to solve this problem?

Upvotes: 0

Views: 294

Answers (0)

Related Questions