pmvc/pmvc

Pure plugin framework (PMVC with PHP8), use anything you like. No mvc, http inside.

1.8.1 2021-10-25 16:22 UTC

README

flow5.png

PMVC

A simple MVC for unidirectional dataflow architecture.

Latest Stable Version Latest Unstable Version CircleCI StyleCI Coverage Status License Total Downloads

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

PMVC Family

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

MIT 2021