Illegal string offset key error cakephp

Asked

Viewed 245 times

0

I’m starting to use CakePhp, when I register something, it returns the following errors:

Warning (2): Illegal string offset 'key' [CORE Cake View Helper Sessionhelper.php, line 143]

Warning (2): Illegal string offset 'message' [CORE Cake View Helper Sessionhelper.php, line 167]

But registered in the bank.

  • 1

    What is the code that generates the error?

  • I did the CRUD by Bake in cmd, and at the time I will register, edit or delete it returns this error. the error function is this: public Function flash($key = 'flash', $attrs = array()) { $out = false; if (Cakesession::check('Message.' . $key)) { $flash = Cakesession::read('Message.' . $key); Cakesession::delete('Message.' . $key); $out = ''; foreach ($flash as $flashArray) { if (!Empty($attrs)) { $flashArray = merge($flashArray, $attrs); } $flashArray['key'] = $key; $out .= $this->_render($flashArray); } } Return $out; }

  • Silas, pay attention, do all that I say in this order and fail none of the items: 1. edit (click on the link above called edit) the question and speaks exactly as you did, step by step - 2. inform the PHP version, 3. inform the cakephp version, 4. inform us if you have installed anything else with cakephp for the use of Views. ... Only by informing us about this can we have a minimal idea of how to help you.

    1. I created a new project in netbeans 8.2 and added the cakephp framework, version 2.10. dpois added the bootstrap plugin, made a test table called users. managed her crud by windows cmd via the Console command cake Bake all; 2. php version 7.0.22; 3. cakephp version 2.10.3; only the most recent bootstrap plugin has been installed.

1 answer

2


I solved the problem changed the version of PHP to 5.5

Browser other questions tagged

You are not signed in. Login or sign up in order to post.