Note that there are some explanatory texts on larger screens.

plurals
  1. POYii: maximizing code reuse with per-user site configurations
    primarykey
    data
    text
    <p>The client I'm working for has a CMS written in Yii. Currently a part of their business is customizing the CMS to meet the specific needs of each customer. About 90% of the code is reused, essentially by copying and pasting from one directory to another. While I've been working on this project, I've had to merge changes in to the shared codebase several times.</p> <p>All, or most, of these sites are hosted on the same server, and it would seem that it would make more sense to have a single login, that changed what features we showed based on the login. In some case that means overriding whole or partial views (eg, the _form.php might change from customer to customer) including the controller and model. Most of the time, it means adding a new controller for a bit of functionality written just for that client.</p> <p>I've read about having both a front and backend site here: <a href="http://www.yiiframework.com/wiki/63/organize-directories-for-applications-with-front-end-and-back-end-using-webapplicationend-behavior" rel="nofollow">http://www.yiiframework.com/wiki/63/organize-directories-for-applications-with-front-end-and-back-end-using-webapplicationend-behavior</a> but that doesn't seem to be the right fit (I don't want everyone coming to a different start php file, for instance)</p> <p>Ideally, I'd have users log in, and get assigned a site id, which will filter data in the shared MVC objects, and will add in the ones specifically for them, or override the ones where necessary</p> <p>Intuitively it seems like something like this would make sense:</p> <p>Shared controllers go here: </p> <pre><code>/protected/controllers </code></pre> <p>Overrides and additions for client1 go here:</p> <pre><code>/protected/controllers/client1 </code></pre> <p>or:</p> <pre><code>/protected/client1/controllers </code></pre> <p>But I'm not sure how to get Yii to do this in the most efficient and easy to manage way. Is this something that's going to work with Yii, or am I breaking it in ways unintended? If it will work, what's the best way to accomplish it so that it's clear to me six months from now, or some random developer who replaces me? </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload