コード例 #1
0
ファイル: Sample.php プロジェクト: decima/M2-platine
class Test3 implements Core_Plugin
{
    public function info()
    {
        return array("name" => "Test3", "core_version" => 1.0, "version" => 1.0);
    }
    public function init()
    {
        return "I'm a lady initialized!";
    }
}
?>

<?php 
echo "<pre>";
$h = new Hooks("admin_muffin_info");
/*
$h->change_plugin_type(Hooks::MUFFINS_ADMIN);

$muffins = $h->invoke_hooks(array(), Hooks::RETURN_MERGE);
print_r($muffins);
*/
$hook = new Hooks("info");
print_r($hook->invoke_hooks());
print_r($hook->invoke_hook("Test1"));
$hook = new Hooks("init");
$hook->change_plugin_type(Hooks::CORE_PLUGINS);
print_r($hook->invoke_hooks());
echo "<------------->";
$hook = new Hooks("info");
print_r($hook->invoke_hook("Test3"));