fup / wordpress-middleware
This PSR-15 middleware allows you to include Wordpress into your Middleware-Pipeline
Requires
- php: ^5.6 || ^7.2
- http-interop/http-middleware: 0.5.0
- roave/security-advisories: dev-master
- zendframework/zend-diactoros: 1.6.1
- zendframework/zend-expressive-template: 1.0.4
Requires (Dev)
- phpunit/phpunit: ^5.7.23 || 6.5.5
This package is not auto-updated.
Last update: 2025-03-30 08:07:10 UTC
README
This PSR-15 middleware allows you to include Wordpress into your Middleware-Pipeline
Getting Started
Prerequisites
- Install Wordpress within a public accesible directory of your webserver.
- install composer if you haven't yet (seriously install composer)
- TemplateRendererInterface Implementation to pass into WordpressAction
Installing
Install Composer
$ composer require fundp/wordpress-psr15-bridge
Generate WordpressAction
with a factory. Inject TemplateRendererInterface
-Implementation, the WordpressBridgeService
within this lib and
public function __invoke(ContainerInterface $container, $requestedName, array $options = null) { $template = $container->get(TemplateRendererInterface::class); $wordpressBridgeService = $container->get(WordpressBridgeService::class); return new WordpressAction($template, $wordpressBridgeService, 'yourproject::your-template'); }
pipe Action into your pipeline
$app->pipe( WordpressAction::class);
register action and your factory in your dependency injection. May look like this with Zendframework
return [ 'factories' => [ WordpressAction::class => WordpressActionFactory::class ] ];
Create a TemplateFile that contains the necessary Template-Variable like this
blank-wordpress.phtml
<?= $this->wordpress_string?>
Running the tests
$ Run, Forrest, run!
Built With
Contributing
Workflow for contributing is not defined yet which leaves all the opportunities to you by now.
Versioning
We use SemVer for versioning. For the versions available, see the tags on this repository.
Authors
- Bastian Charlet - Initial work - Bastianowicz
License
This project is licensed under the MIT License - see the LICENSE.md file for details
Acknowledgments
- Inspired by legacy integration approach of RalfEggert