Download the PHP package clubdeuce/wpmvc-redux without Composer
On this page you can find all versions of the php package clubdeuce/wpmvc-redux. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download clubdeuce/wpmvc-redux
More information about clubdeuce/wpmvc-redux
Files in clubdeuce/wpmvc-redux
Package wpmvc-redux
Short Description An MVC library for WordPress application development
License MIT
Informations about the package wpmvc-redux
wpmvc-redux
An MVC base library for WordPress plugin and theme development. Provides typed base classes for models, custom post types, and taxonomies, following PSR-4 autoloading standards.
Requires PHP 8.3+
Installation
Architecture
Usage
Application
Extend Application to create your plugin entry point. Implement HasActions to register WordPress hooks automatically on construction.
A ?ContainerInterface $container property is available for dependency injection. Assign it via set_state() or a subclass constructor.
Post model
Extend Base\Post to wrap a custom post type. All WP_Post properties are available via typed accessors — no raw property access needed.
Template rendering
the_template() locates and renders a .php template file. Lookup order: child theme → parent theme → module dir (if module_dir() is overridden).
Inside the template, $item is automatically available as a reference to the model instance, alongside any variables passed in the second argument:
Override templates_subdir() to change the theme subdirectory (defaults to templates, or WPLIB_TEMPLATES_SUBDIR if defined). Override module_dir() to enable a plugin-level template fallback.
Term model
Extend Base\Term to wrap a taxonomy term.
Post_Type controller
Extend Controllers\Post_Type (abstract) to register a custom post type. Define const ?string POST_TYPE and set $arguments.
slug() returns the POST_TYPE constant value.
Taxonomy controller
Extend Controllers\Taxonomy (abstract) to register a custom taxonomy.
slug() returns the TAXONOMY constant value.
HasActions interface
Implement Contracts\HasActions on any Application subclass that needs to register hooks. The constructor calls add_actions() automatically when the interface is detected.
Development
Requirements
- PHP 8.3+
- Composer
Install dependencies
Run tests
Static analysis
Configuration is in phpstan.neon.dist. Create a local phpstan.neon for environment-specific overrides — do not edit phpstan.neon.dist directly.
PSR-4 namespaces
| Namespace | Directory |
|---|---|
Clubdeuce\Wpmvc_Redux |
src/ |
Clubdeuce\Wpmvc_Redux\Tests |
tests/ |
License
MIT — see LICENSE.

