2017 © Pedro Peláez
 

library hook

Do action and filters with Herbert

image

flycartinc/hook

Do action and filters with Herbert

  • Thursday, March 16, 2017
  • by flycart
  • Repository
  • 3 Watchers
  • 0 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Flycart Hook for Herbert

Add the bellow piece of code in plugin.php to set $app in Facade, (*1)

if ( is_plugin_active(plugin_basename( __FILE__ )) ) {, (*2)

$plugin = new \Herbert\Framework\Base\Plugin(plugin_dir_path( __FILE__ ));, (*3)

$herbert->registerPlugin($plugin);, (*4)

$app = $plugin->getContainer();, (*5)

FlycartHook\Facades\Facade::setFacadeApplication($app);, (*6)

}, (*7)

Add the bellow piece of code in herbert.config.php to load FlycartHook service provider, (*8)

'providers' => array(, (*9)

FlycartHook\HookServiceProvider::class, (*10)

), (*11)

# Flycart Hook Example, (*12)

\FlycartHook\Facades\Action::add('init', 'ClassName@functionName');, (*13)

\FlycartHook\Facades\Action::run('eventname', $args);, (*14)

\FlycartHook\Facades\Filter::add('eventname', 'ClassName@functionName');, (*15)

\FlycartHook\Facades\Filter::run('eventname', $args);, (*16)

The Versions

16/03 2017

dev-master

9999999-dev

Do action and filters with Herbert

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Ashlin Rejo