Best Practice: Where to Put Global Logic?

edited January 2014 in Share
Hello,
I am new to FuelCMS. I am looking for advice on where keep code segments that require a little bit of logic and define global variables. For example, conditions to check for authenticated user and set login/logout buttons accordingly. I understand that I *could* put simple if/else statements in the header block/view itself. I understand that I *could* put this type of code in /views/_variables/global.php. But what I really want to understand is this: Where does logic that applies to all pages belong? I don't want to put it in the view itself because I fear that it will grow and ruin the purpose of the view. I hope this makes sense. ALL advice is appreciated.
Mark

Comments

  • edited 5:21PM
    You could create a library or helper to contain the logic and then simply call the function or method in your view.
Sign In or Register to comment.