Within one of my view scripts, I am showing a table of data for lets say, cars. Based on the type of car (using a switch statement), I show a different image. I do this in a couple different views, so I was wondering, should I be using a view helper to handle this so I don’t duplicate the switch statement in multiple areas? Thanks for any input!
Share
Yes. A view helper sounds the most appropriate, but you could potentially use a partial by itself… just passing in the value youre switiching.