a PHP MVC Framework for the ProcessWire CMS/CMF
a PHP MVC Framework for ProcessWire
- Template rendering in a MVC Pattern (done)
- ProcessWire as a Service (done)
- Twig as optional Template Engine (not ready)
- Symfony Dependency Injection / Container (done)
- Symfony Controller Resolver based on the Template (done)
- PHPUnit as a Testsuite (done)
Symprowire offers a structured way to render your ProcessWire files and compose your data. Symprowire implements the Symfony/HttpFoundation and handles the template rendering in a Request - Process - Response workflow. This extends Symprowire driven templates with the following features
- Dependency Injection
Symprowire integrates fully with ProcessWire and does not alter the Core in any way. To use Symprowire, even in your existing sites, you just have to copy the controller template file.
Symprowire will generate his routing based on the available ProcessWire Templates. The runtime scans every Template for the alternative Templatefile "controller". This will add a /$template->name route to the RouteCollection which will always resolve to a Controller::index action. To add new Views to your Template you either provide a _sympro=$method GET Parameter to your URL or you use Route Annotations.
- fresh installed ProcessWire 3.x
- PHP >=8.0.2
Symprowire gets called via Template file by ProcessWire and will be processed by page->render().
- Download ProcessWire 3.x from the ProcessWire Homepage
- Install ProcessWire with debug mode enabled and setup your Environment
- Now open up the
/sitefolder in the Terminal of your liking
- Init your Project with
composer initand follow the instructions
composer require symprowire/symprowire
vendor/symprowire/symprowire/templates/controller.phpinto your templates folder
- change the Alternative Templatefile to 'controller'
- Make sure that
You have to follow PSR-4 naming conventions and have to use site/src for your App in composer.json
- Tracy Debugger
- 100 -> Request // Errors thrown during Request creation
- 200 -> SymproWireEngine // Errors from the Kernel
- 300 -> SymprowireController // Userland
- 400 -> SymprowireService // Error Code Level for Services