Can you help me understand something about variables?
Hi,
I'm trying to get to know FuelCMS and how variables are passed around between models, views, controllers etc.
I think I'm getting there, but I'm a bit puzzled about how the default 404 page works. In the 404 layout file it echoes fuel_var('heading') and fuel_var('body'), but I can't seem to find where these variables are set. There isn't a 404 controller or _variables file and these are not set in the global variables file, so where are the heading and body variables set for this layout?
Many thanks
Comments
they are helper functions from fuel_helper.php. Their parameters are fields from the layout files in application/config/MY_fuel_layouts.php, or failing that, any of that name / key in the array sent to views.
1. Create a view file called "404_error". This will be used in conjunction with the fuel/application/views/_layouts/404_error.php layout file.
2. Create a page in the CMS called "404_error". This too will use the fuel/application/views/_layouts/404_error.php layout file.
The variables for those pages are set either in the CMS and/or using the variables files.
http://docs.getfuelcms.com/general/pages-variables