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

252 views Asked by At

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?

0

There are 0 answers