Note the upgraded forum! If you are experiencing issues logging in, you may need to reset your password which should send an email. If the email doesn't arrive, be sure to check your spam folder just in case.

Variable Scope Across Blocks

edited May 2017 in Bug Reports

I'm finding that params provided to fuel_block() are existing across further calls to fuel_block within the same page load.


{fuel_block('some_block', array(foobar='123'))}

<?= (isset($foobar) ? $foobar : 'not set') ?>


I would expect the output to be "123 not set". Is this intended functionality? If so how to I unset the parameters provided so that further calls to a fuel block does not require my users to provide a full set of params?




  • edited 10:48PM
    That would seem to be expected behaviour. Perhaps the second call should be more like:
  • edited 10:48PM
    Just seems a little odd to me as it kills any ability for further blocks to have 'default' like behaviour, which in turn makes it more complicated for my users of the CMS.
  • edited 10:48PM
    There is a 'scope' parameter you can pass as an argument to fuel_block's configuration array which can help ensure that those values are unique. The scope value should be a unique string key.
Sign In or Register to comment.