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

  • edited April 2014
    Hi,

    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.
  • edited 9:33PM
    Thank you for your feedback, Gumster, but I'm still not clear where the values of these parameters for the 404 page are set. i.e. the value for fuel_var('heading') is "404 Page Not Found", but I cannot find a controller or values file where it is set to this value. Can you help?
  • edited 9:33PM
    By default, the fuel/application/errors/error_404.php file, the same one CodeIgniter uses, is used to display the 404 error. However, there are a couple other ways to create the 404 error page:

    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
  • edited 9:33PM
    Thank you!
Sign In or Register to comment.