0

我的组件的 PHP 代码段如下所示:

...
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
}
...
}
...

显示如下错误:
Call to a member function is() on null
如何解决这个问题?

4

0 回答 0