pmvc / pmvc
Pure plugin framework (PMVC with PHP8), use anything you like. No mvc, http inside.
3.1.1
2026-03-23 06:04 UTC
Requires
- php: >=5.6.0
Requires (Dev)
This package is auto-updated.
Last update: 2026-06-24 01:07:39 UTC
README
- PMVC
- Getting Started
- How to use?
- [M]odel [V]iew [C]ontroller
- PMVC Family
- Explain addPlugInFolders
- Quick test
PMVC
A simple MVC for unidirectional dataflow architecture.
Getting Started
How to use?
plug( 'PluginName', ['option'] );
Plugin Hello world
- Source Code
<?php
namespace PMVC\PlugIn\hello_world;
${_INIT_CONFIG}[_CLASS] = __NAMESPACE__.'\hello_world';
class hello_world extends \PMVC\PlugIn
{
public function say()
{
echo $this[0]."\n";
}
}
- Used
\PMVC\plug('hello_world', ['Hello, PMVC.'])->say();
PlugIn features
- addPlugInFolders
- callPlugin
- unPlug
- rePlug
- initPlugIn
- plug
PlugIn Generator
MVC
- Controller
- View
- https://github.com/search?q=topic:pmvc-view
- view_react
- view_html
- view_json
- view_cli
- Model
- MVC Demo Project
PMVC Family
- Core Library
- PMVC Plug-ins
- PMVC Applications
- PMVC Themes
Explain addPlugInFolders
The last folder will have more high priority.
Such as
addPlugInFolders(['./a', './b'])
If folder a and folder b both have same plugin will apply with folder b.
Quick test
composer require pmvc/pmvc
Quick test with docker
docker run --rm -v $(pwd):/var/www/html allfunc/pmvc-phpunit composer require pmvc/pmvc
- vim test.php
<?php
include_once('vendor/autoload.php');
\PMVC\Load::plug();
\PMVC\d("Hello There");
- Run
docker run --rm -v $(pwd):/var/www/html allfunc/pmvc-phpunit php ./test.php
MIT 2026
