So basically I struggle with the need to optimize my code for my project. Currently I have pages like add_company.php , view_company.php , edit_company.php .
What I would like to do is serve all the content from only one company.php PHP file. So to say company.php?action=view , company.php?action=edit , etc. Is this the only way to do this with massive if else expressions? That would make my company.php look like mega huge.
Or maybe even better, how can I serve all my pages just using index.php?
So what would be the best way to achieve this? I am not a php guru and I donβt have much experience with MVC or any other template.
Thanks.
source share