PHP code example of wp63 / acf-block-loader

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

    

wp63 / acf-block-loader example snippets



namespace App\Blocks;

use WP63\Block;

class MyBlock extends Block {
  protected function register() {
    return [
      'name' => $name,
      'title' => $title,
      'category' => $category,
      'fields' => $fields,
    ];
  }

  public static function render( $options ) {
    // You can directly render HTML within `render()` method
    ...
    display block html
    ...

    // Or alternatively, return an array for Blade template engine in Sage 9
    return [
      'name' => 'value', // $name in template file
      'foo' => 'bar', // $foo in template file
    ];
  }
}