Skip to content

pmvc/pmvc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Table of Contents

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

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 2023

About

Pure plugin framework, use anything you like. The best framework which not forcing you to follow annoying rules.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published