• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MVC Best Practices

#2
[eluser]gon[/eluser]
I would write a library for that.

So you just have to load the library, and it automatically checks if the user is logged, and if it has alerts or not.
In the library you could write a method like "get_alerts_html". So it will return null if there is no alerts, or the html for showing the alerts.
You won't have to put logic in the controllers or views. Just put <?=$user_alerts?> in the views. If there are no alerts, nothing will be shown.


Messages In This Thread
MVC Best Practices - by El Forum - 08-19-2008, 01:40 PM
MVC Best Practices - by El Forum - 08-19-2008, 01:45 PM
MVC Best Practices - by El Forum - 08-19-2008, 01:50 PM
MVC Best Practices - by El Forum - 08-19-2008, 01:51 PM
MVC Best Practices - by El Forum - 08-19-2008, 03:50 PM
MVC Best Practices - by El Forum - 08-20-2008, 06:13 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.