- PMVC
- Getting Started
- How to use?
- [M]odel [V]iew [C]ontroller
- PMVC Family
- Explain addPlugInFolders
- Quick test
A simple MVC for unidirectional dataflow architecture.
- https://github.com/pmvc/pmvc/wiki
- Heroku (or Dokku) ready app test
plug( 'PluginName', ['option'] );
- 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();
- addPlugInFolders
- callPlugin
- unPlug
- rePlug
- initPlugIn
- plug
- Controller
- View
- https://github.com/search?q=topic:pmvc-view
- view_react
- view_html
- view_json
- view_cli
- Model
- MVC Demo Project
- Core Library
- PMVC Plug-ins
- PMVC Applications
- PMVC Themes
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.
composer require pmvc/pmvc
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 2023