08-19-2008, 01:40 PM
[eluser]darkhouse[/eluser]
I'm just trying to find out how the best way to do things are. For instance, I have a site that's almost done, and I need to add an "alerts" area into the header of all pages if a user is logged in. If they have at least 1 new alert, the link will say "You have 1 new alert". The HTML for the area is in just one view file, but the view is loaded from every controller, so it seems like I need to add the functionality to get the number of alerts into every controller wherever the view is loaded, but it seems redundant to me.
Can somebody enlighten me on some best practices for this sort of thing, or any other tips, I'm still fairly new to the concept of MVC, though I love it.
I'm just trying to find out how the best way to do things are. For instance, I have a site that's almost done, and I need to add an "alerts" area into the header of all pages if a user is logged in. If they have at least 1 new alert, the link will say "You have 1 new alert". The HTML for the area is in just one view file, but the view is loaded from every controller, so it seems like I need to add the functionality to get the number of alerts into every controller wherever the view is loaded, but it seems redundant to me.
Can somebody enlighten me on some best practices for this sort of thing, or any other tips, I'm still fairly new to the concept of MVC, though I love it.