项目作者: javanile

项目描述 :
WordPress extension framework based on object-oriented paradigm.
高级语言: PHP
项目地址: git://github.com/javanile/granular.git
创建时间: 2018-05-14T12:11:52Z
项目社区:https://github.com/javanile/granular

开源协议:MIT License

下载


WP Granular

StyleCI
Build Status
codecov
Codacy Badge
License: MIT

WordPress extension framework based on object-oriented paradigm.
Using Granular you can write PSR compliant code increasing the general code quality
performing a better project organization. Organize your code in feature
or group WordPress actions and filters in the same scope.

  1. namespace Acme\Plugin;
  2. use Javanile\Granular\Bindable;
  3. class MyFirstPluginFeature extends Bindable
  4. {
  5. static $bindings = [
  6. 'action:init',
  7. 'filter:the_content' => 'theContent',
  8. ];
  9. public function init()
  10. {
  11. // Init code
  12. }
  13. public function theContent($content)
  14. {
  15. return $content;
  16. }
  17. }
  1. use Javanile\Granular\Autoload;
  2. $app = new Autoload();
  3. // add MyPlugin::init() method to WordPress init action
  4. $app->register(MyPlugin::class, 'init');

Testing

  1. $ docker-compose run --rm phpunit --stop-on-failure tests