Ok I feel like I have to edit the Template Controller here.. but we shouldn't be editing/touching the core in FuelPHP right? Unless it's a config? So we can easily upgrade...
How do you pass user information on every page load? I dont want to have to pull the data on EVERY single controller I create for other stuff... Just seems so repetitive.
So I've been editing the template controller, but I feel like I shouldn't be doing that since when I upgrade Fuel, it replaces that controller again...
Does anyone have any suggestions how to pass usernames and stuff to the template BESIDES pulling it from every controller for every page you create?
You could extend the Template Controller in your own app using methods described on the Extending the Core page in the documentation. That way when you update FuelPHP, your modifications would not be replaced and you wouldn't have to pass user information in every controller you create.
Correct. Create a base controller where you do all your global stuff, and have your controllers extend the base controller instead of Controller_Template.
THANK YOU :) I did create a Base Controller :) Lovely workarounds!
I however did edit the auth package though D: I just will make sure not to replace it. I wanted the Session::set('userid') to be set. I don't like holding sessions by username because I pull all data with a user_id for more efficiency and faster results. :)
The Auth library uses that user_id field to determine if someone is logged in. If you remove that, the Auth functionality no longer works, and you have to maintain user state manually.
And I don't understand you're second statement. The Auth library already maintains the information of the current user, there is no need to pull it again...