PHP code example of netsells / attribute-finder

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

    

netsells / attribute-finder example snippets


use Netsells\AttributeFinder\AttributeFinder;

$finder = new AttributeFinder(__DIR__);

$classes = $finder->getClassesWithAttribute(TestAttribute::class);

foreach ($classes as $class) {
    $attribute = $class->getAttributes(TestAttribute::class)[0];
    $attributeInstance = $attribute->newInstance();
    // Do whatever you want with the given attribute instance
}