Added base_url helper to blocks.
This commit is contained in:
@@ -69,6 +69,11 @@ class Component_Builder {
|
||||
|
||||
$this->dist_path = __DIR__ . '/' . $this->module_path . '/../../' . $this->project_path . '/exports' . '/' . $args['platform'];
|
||||
$this->register_default_handlebar_helpers();
|
||||
|
||||
$this->add_handlebar( 'base_url', function ( $context ) {
|
||||
$path = join( '/', [ 'blocks', $this->block_project, $this->block_name, 'templates' ] );
|
||||
return plugins_url( $path . '/', 'axeweb-blocks-library/axeweb-blocks-library.php' );
|
||||
} );
|
||||
}
|
||||
|
||||
function build(): void {
|
||||
|
||||
Reference in New Issue
Block a user