0
I need to define a variable that will be displayed in the footer of all my pages, ie in the cake 3 template. Any ideas?
0
I need to define a variable that will be displayed in the footer of all my pages, ie in the cake 3 template. Any ideas?
1
You have to see the situation, there are several ways to do this, one of them is to pass the beforeRender or Appcontroller initialize, and set the variable there, so that all system views have access.
Yes, I’m currently doing it for the Appcontroller beforeRender, but I still think there should be some better and more specific way. I’m passing unnecessary variables to views that don’t use this layout.
Browser other questions tagged php cakephp cakephp-3
You are not signed in. Login or sign up in order to post.
Please read out How to create a Minimum, Complete and Verifiable example. In the documentation of the tool you can pass variables of the controller to the view.
– Woss
@Andersoncarloswoss does not need code example, all I need is the information from where to insert a variable that will be passed to the layout view.
– Lucas Thibau Paulino
Have you tried to see something in documentation?
– gmsantos