What it is? What I have not tried, I can’t remove it.

class CartController extends AppController { public function actionAdd(){ echo 'ok'; } } 

Result:

enter image description here

enter image description here

  • Dear participant, please insert the stack trace in the form of text, not an image. Why is this necessary . Thank. - Sasha Chernykh
  • What do you have on line 18 in CartController.php? - madfan41k
  • In line 18 - echo 'ok'; - Dmitry Gladkikh
  • then you have before this echo somewhere there is a display of information - madfan41k

1 answer 1

Headers cannot be sent after the response body has already been sent. Instead of echo 'ok'; need to use return. Constructions echo, usually used in the files views / *. It is probably worth re-reading the documentation again.