PHP code example of dongnan / microaop

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

    

dongnan / microaop example snippets

 php

namespace yournamespace;

class Model {

    public function save() {
        echo __METHOD__ . ' has been executed' . PHP_EOL;
    }

}
 php

namespace yournamespace;

class Aspect {

    public function saveBefore($params) {
        echo '------------------------------------------' . PHP_EOL;
        echo __METHOD__ . ' has been executed' . PHP_EOL;
    }

    public function saveAfter($params) {
        echo '------------------------------------------' . PHP_EOL;
        echo __METHOD__ . ' has been executed' . PHP_EOL;
    }

}