Alloy's internal architecture is fairly unique when compared to most other PHP frameworks available. The most significant difference is that Alloy follows a Hierarchal MVC pattern that allows and even encourages multiple controllers to respond to a single request. Another big difference is that Alloy groups sets of controllers, models, and views together into a single self-contained folder called a module (i.e. "Blog").

Hierarchical MVC (HMVC)

Alloy was specifically designed to use multiple controller dispatches in a single request to form a single response. HMVC design solves the "widget problem" in a concise and elegant manner that does not require any additional control structures like "widget" or "component" classes to display nested content (either related or unrelated) within a single view.

Modular Organization

Instead of generic "controllers", "models", and "views" folders at the root level, Alloy organizes all related controllers, models, and views into a single self-contained folder called a module. This folder must contain at least a "Controller.php" file to handle web requests, and can contain any number of additional files, classes, or submodules as many levels deep as required to achieve the desired functionality.


Alloy has a unique central Kernel object that serves as the single and central access point to get almost anything else you need within the framework. The Kernel blends a few design patterns together to be more useful, and can generally be thought of as holding the context of your application - the current request, response, configuration, routes, etc. In terms or design patterns themselves, the Kernel is a blend of Service Locator, Registry, Configuration, Dispatcher, and Proxy.

Explicit over Implicit

As a general rule, Alloy favors explicitness over implicitness where it makes sense. That is, Alloy wants you to tell it what to do instead of making too many assumptions and automatically trying to do something you don't want it to. This is most evident in the module controllers - another area where Alloy significantly differs from most other PHP frameworks.

Related Links