October 22, 2024
Chicago 12, Melborne City, USA
PHP

Which is better conditional rendering or separation of files in PHP?


i have a website where there are users with multiple privileges with difference in UIs and actions that are allowed/not allowed in the page , i have been overthinking about an approach that will make our lives more easier and we mainly have 3 privileges for now , i started already with conditional rendering however i find it annoying that i have to make 3 if conditions that check for privilege to display the UI accordingly for example the sidebar have a list of actions/functions that a user can do and this list differs for each privilege and also the dashboard is different , i’m unsure of what is considered a best practice in this scenario



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video