global.php with controller

FvGFvG
edited October 2011 in Bug Reports
I'm using the global.php file to give my templates some variables. It works fine everywhere, using the templates with a controller it doesn't. Any idea how I can use the globa variables with a controller too?

Comments

  • edited 12:35AM
    If you are using a controller you will need to render your page using the Fuel_page library as explained on this page under the section about using controllers.
    http://www.getfuelcms.com/user_guide/general/creating-pages
  • FvGFvG
    edited 12:35AM
    Thanks but there seems to be a bug in it. If I'm using
    $this->load->module_library(FUEL_FOLDER, 'fuel_page', array('location' => '_folder/file')); I get an 404-Error. Using
    $this->load->module_library(FUEL_FOLDER, 'fuel_page', array('location' => 'folder/file')); everything works. Looks like I can't use a folder beginning with _
  • edited 12:35AM
    That's correct. File names and folders beginning with an underscore aren't viewable if using the "opt-in" controller method or using a controller and the Fuel_page class to render the page
  • FvGFvG
    edited 12:35AM
    But why? Is there any way to fix this? If I have a view to be used with a controller, I don't want it to be accessible without controller! It gets wo many variables from it, without it was a page full with errors!
  • edited 12:35AM
    To get around this issue, you can try specifying a 'view' variable like so:
    $this->load->module_library(FUEL_FOLDER, 'fuel_page', array('location' => 'folder/file')); $this->fuel_page->add_variables(array('view' => '_folder/file')); $this->fuel_page->render();
Sign In or Register to comment.