Yii Aliases & Namespaces versus sharing programs between systems

Hi all.

Suppose that I have some Yii systems in development (or in production).

All of them have the same "Administration" menu with Profiles, Tasks, Menus, Users, etc, as sub-menu-itens.

The collection of programs for the administration menu is a common group of all applications.

How can we deal with it ?

Replicate all group, into each system? (the worst scenario that I mean)

Create a pointer (Yii Alias) to a directory that contains the structure that houses the group ? This works (how) ?

TIA

MN.

Do not duplicate because you would face maintenance issue.

You can create Yii path aliases to reference those common code. Simply add some Yii::setPathOfAlias() at the beginning of your app configs.

Let me see if I understand you.

So, if I have a set of programs (views, models and controllers) located in a docroot subdir and structured like Yii, which are common to other systems, I could point them?

Something like:

webroot / common

… / Controllers

… / models

… / views

webRoot/application1

Yii::setPathOfAlias('WebRoot.common');

webRoot/application2

Yii::setPathOfAlias('WebRoot.common');

TIA

MN