PHP code example of fys / hook-bundle

1. Go to this page and download the library: Download fys/hook-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

fys / hook-bundle example snippets


// AppBundle/Component/Hooks/HeadHook.php

namespace AppBundle/Component/Hooks;

use FYS\HookBundle\Component\HookInterface;

class HeadHook implements HookInterface
{
    public function getName()
    {
        // the hook name, for example "head"
        return 'head';
    }
    
    pubilc function getAction()
    {
        // the action when the hook is called
        return 'HELLO THIS IS MY FIRST HOOK';
    }
    
    public function getPriority()
    {   
        // the priority of this hook
        return 1;
    }
}