php - Conditionally allow functionality/render views in MVC? -
i'm using basic mvc pattern (customised version of https://github.com/panique/php-mvc) php application.
i'm not sure right way handle scenario this:
lets app used 2 different companies. each company wants have specific functionalities. there core functionalities shared companies. need manage user privileges in each company (admin, employee, etc.).
my goal have "modules" (specific functionality - dashboard, profile page, ...) , have them loaded conditionally each company + affected user privileges.
also need somehow load different layout each company. (not totally different, slight changes only.)
i've googled bit , found stuff acl , decorator, think aren't i'm looking for.
what best way case?
thanks in advance.
i assume (sorry, no time check) framework mvc-like single point entry (bootsrtap). whole bussiness logic , request proccessing stays same each company, config different.
for start need add together 1 domain top-level url part (main folder or subdomain), extract company name/alias/id url request ($_get) , utilize variable load proper config - db entry (at least), maybe activated modules (if not stored in db), personalized view (file prefix/folder name) etc. comes little .htaccess & framework enhancement in (app) config loading part (variable path). rest writing total working app 1 hypothetical company modules activated:)
your homepage (domain url) serve dispatcher concrete company (it doesn't have framework based - plain html links do), simpler having mutual database serve automatic dispatcher other dbs (not hard thing do, i'd leave later developement).
php model-view-controller
No comments:
Post a Comment