PHP code example of ltsc / iaop

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

    

ltsc / iaop example snippets


//Your class instance
$myObj = new MyObj();
//You can add one $before and one $after there,
//or add after
$demo = new AOP($myObj);
$demo->addBefore(function($method, $arguments) {
    //do something
    //$method and $arguments recv the method(argument[])
});
$demo->addAfter(function($result, $method, $arguments) {
    //do something
    //$result recv the return of method(argument[])
});
$demo->myFunc(...something...);