Call to undefined function is()

Hi, more recently I started to deal with CakePHP, I’m writing a function to add a material with a modal form (PopUP - a flashing window) to the database, I registered a function that should keep all the contained forms in the database, but when I refresh the page I get an error Call to undefined function is (), tell me, please, where I made a mistake when writing functions. Listing of the function I am attaching:
public function index() {
// debug($this->request->data);
if ($this->request-is(‘post’)){
$this->redirect([‘action’ => ‘index’]);
} else{


if ($this->request-is(‘post’)){

you have minus (-) instead of object operator (->)

1 Like