PHP code example of vendi-advertising / vendi-component-loader

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

    

vendi-advertising / vendi-component-loader example snippets


add_action(
    'vendi/component-loaded/loading-template',
    static function($name, $folders, $path) {
        // Do something here
    },
    10,
    3
);

add_action(
    'vendi/component-loaded/missing-template',
    static function($name, $folders, $path) {
        // Do something here
    },
    10,
    3
);

use Vendi\Shared\WordPress\VendiComponentLoader;

function YOUR_PREFIX_load_video_component(string $name)
{
    VendiComponentLoader::load_component_by_folder($name, [VendiComponentLoader::SHARED_PARENT_FOLDER, 'video']);
}