PHP code example of underpin / block-loader

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

    

underpin / block-loader example snippets


// Register styles and scripts.
underpin()->styles()->add( 'test-style', [/*...*/] );
underpin()->scripts()->add( 'test-script', [/*...*/] );

// Register block
underpin()->blocks()->add( 'test', [
	'name'        => 'Test Block',
	'description' => 'Description for block.',
	'type'        => underpin()->dir() . 'block.json', // Can be the block ID or a link to a block.json file. See register_block_type
	'args'        => [],                               // Optional. See register_block_type
] );


underpin()->blocks()->add('block-key','Namespace\To\Class');