HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Please upgrade here. These earlier versions are no longer being updated and have security issues.

Include Model in Menu

edited March 2010 in Vanilla 2.0 - 2.8
How can I include a model for my application across all pages so I can use one of the functions within the Header Menu?

Example:
public function Base_Render_Before(&$Sender) { if($Sender->Menu && Session->IsValid()) { $Sender->MyApplication->MyFunction($Session->UserID); } }

I'd like to include the model for MyApplication for use in the main menu at all times. Thanks for any help you can provide!

Comments

  • /bump
  • MarkMark Vanilla Staff
    edited April 2010
    Are you building a plugin or an actual application?

    If it is an application, you should be able to just instantiate the model and Garden will find, include, and instantiate it for you. If it's a plugin, you can include the file right above your plugin's class definition.
  • Thank you! It's an application. I've instantiated my model; but Garden doesn't seem to find it and include it in the header.
Sign In or Register to comment.