PHP code example of afbora / kirby-template-hooks

1. Go to this page and download the library: Download afbora/kirby-template-hooks 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/ */

    

afbora / kirby-template-hooks example snippets




return [
    'hooks' => [
        'page.product.update:after' => function ($newPage, $oldPage) {
            // your code goes here
        }
    ]
];




return [
    'hooks' => [
        'file.cover.update:after' => function ($newFile, $oldFile) {
            // your code goes here
        }
    ]
];