I need to change the CSS class name on the wrapping div and therefore tried to use setTemplates
example from CakePHP book.
I have just copied and pasted the following lines from the example:
$myTemplates = [
'inputContainer' => '<div class="form-control">{{content}}</div>',
];
$this->Form->setTemplates($myTemplates);
After running the code I keep getting the Array to string conversion
warning. The code is still working, but that warning is annoying as it is breaking the layout with debug turned on. I don't want to turn the debug off because of that silly warning. Any hint on how to get rid of it?
EDIT
As per suggestion here is the stacktrace:
include - APP/Template\Layout\default.ctp, line 49
Cake\View\View::_evaluate() - CORE\src\View\View.php, line 1010
Cake\View\View::_render() - CORE\src\View\View.php, line 971
Cake\View\View::renderLayout() - CORE\src\View\View.php, line 642
Cake\View\View::render() - CORE\src\View\View.php, line 600
Cake\Controller\Controller::render() - CORE\src\Controller\Controller.php, line 623
App\Controller\PagesController::display() - APP/Controller\PagesController.php, line 61
Cake\Controller\Controller::invokeAction() - CORE\src\Controller\Controller.php, line 440
Cake\Http\ActionDispatcher::_invoke() - CORE\src\Http\ActionDispatcher.php, line 119
Cake\Http\ActionDispatcher::dispatch() - CORE\src\Http\ActionDispatcher.php, line 93
Cake\Http\BaseApplication::__invoke() - CORE\src\Http\BaseApplication.php, line 78
Cake\Http\Runner::__invoke() - CORE\src\Http\Runner.php, line 65
Cake\Routing\Middleware\RoutingMiddleware::__invoke() - CORE\src\Routing\Middleware\RoutingMiddleware.php, line 59
Cake\Http\Runner::__invoke() - CORE\src\Http\Runner.php, line 65
Cake\Routing\Middleware\AssetMiddleware::__invoke() - CORE\src\Routing\Middleware\AssetMiddleware.php, line 88
Cake\Http\Runner::__invoke() - CORE\src\Http\Runner.php, line 65
Cake\Error\Middleware\ErrorHandlerMiddleware::__invoke() - CORE\src\Error\Middleware\ErrorHandlerMiddleware.php, line 93
Complete warning:
Notice (8): Array to string conversion [APP/Template\Layout\default.ctp, line 49]
Line 49:
'inputContainer' => '<div class="form-control">{{content}}</div>'