Member Avatar for iamthwee

I've asked this before and I'm really racking my brains here.

To create an admin controller or simply have an if statement in the view.

view

if session == admin
    show admin delete post

This would minimize my code so much. I really can't see the wrongness in this. Although it may contravene true MVC patterns.

Showing the delete post link is view dependent (so kind of acceptable), but don't forget to include the same check in your controller. The other option is to create two separate views, one for a user, one for an admin.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.