rosasurfer / ministruts
MVC micro framework for PHP inspired by Java Struts
Requires
- php: ^7.4|^8.0
- ext-ctype: *
- ext-filter: *
- ext-json: *
- ext-libxml: *
- ext-mbstring: *
- ext-simplexml: *
- psr/container: ^1.0|^2.0
Requires (Dev)
- phpstan/phpstan: ^1.11|^2.0
- phpunit/phpunit: ^9.5
- slevomat/coding-standard: *
- dev-master / 0.12.x-dev
- 0.12.0-rc.2
- 0.12.0-rc.1
- 0.11.x-dev
- 0.11.6
- 0.11.5
- 0.11.4
- 0.11.3
- 0.11.2
- 0.11.1
- 0.11
- 0.10.x-dev
- 0.10.9
- 0.10.8
- 0.10.7
- 0.10.6
- 0.10.5
- 0.10.4
- 0.10.3
- 0.10.2
- 0.10.1
- 0.10
- 0.9.x-dev
- 0.9.4
- 0.9.3
- 0.9.2
- 0.9.1
- 0.9
- 0.8.x-dev
- 0.8.6
- 0.8.5
- 0.8.4
- 0.8.3
- 0.8.2
- 0.8.1
- 0.8
- 0.7.1
- 0.7
- 0.6.1
- 0.6
- dev-development
- dev-feature-input-facades
- dev-feature-chainable-assertions
This package is auto-updated.
Last update: 2025-06-15 17:04:26 UTC
README
MiniStruts
MVC micro framework for PHP inspired by Java Struts
M - The basis of the model component is an ORM. The ORM is implemented as "DataMapper" and follows the "database first" approach. This approach is primarily intended for working with existing databases. The implementation requires neither code generation nor proxy classes (no surprises from code you didn't write). As long as tables have primary keys, any standard or non-standard db model can be connected and customized. The configuration is done in pure PHP (no annotations or attributes). The ORM is inspired by Hibernate.
V - The view component is realized by a layout engine which is inspired by the Struts Tiles plugin. Pages can be composed using re-usable layouts and HTML fragments. Both can be configured and extended as needed. Template language is pure PHP (no pre-compiling of HTML necessary).
V - The view component is realized by a layout engine inspired by the Struts Tiles plugin. Pages can be assembled from reusable layouts and HTML fragments. Both can be configured and extended as needed. The template language is pure PHP (no pre-compilation of HTML necessary).
C - The controller part is comprised of application framework, configuration, service container, access control, caching, error handling and logging. The web stack of the framework was inspired by Java Struts 1. Version 1 had long since been superseded by its successor and was practically no longer used. But in 2022 developers decided to revive it because of its simplicity and solidity, and to adapt it to current web standards. Long live Struts...
The project includes a special feature for command line interfaces that is worth mentioning: a syntax parser for the DocOpt standard, which is well known in the Linux/Python world, but little known in the PHP universe. The DocOpt standard uses the syntax description of the tool itself to define call options. At runtime, the syntax description is parsed and validated against the current call. The result are beautiful syntax definitions even for more complex tools (no more ugly Symfony error messages). Examples are here, or you can try out the online parser here.
Mini-Struts reference: struts-config.dtd
ORM mapping reference: README.md