PHP code example of flexpress / component-hooks

1. Go to this page and download the library: Download flexpress/component-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/ */

    

flexpress / component-hooks example snippets


$pimple['configHookable'] = function() {
  return new Config();
};

$pimple['hooker'] = function ($c) {
  return new Hooker($c['objectStorage'], array(
    $c['configHookable']
  ));
};


class Config {

  use HookableTrait;
  
  /**
   * @type action
   */
  public function adminInit() {
    echo "Hello, this is the admin hook being fired";
  }

}

class Config {

  use HookableTrait;
  
  /**
   * @type action
   */
  public function adminInit() {
    echo "Hello, this is the admin hook being fired";
  }
  
  /**
   * @type filter
   */
  public function theTitle($title) {
    return strip_tags($title);
  }

}