WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Blocks\Utils

BlockTemplateUtils::generate_template_slug_from_path() public WC 1.0

Converts template paths into a slug

{} It's a method of the class: BlockTemplateUtils{}

No Hooks.

Return

String. slug

Usage

$result = BlockTemplateUtils::generate_template_slug_from_path( $path, $directory_name );
$path(string) (required)
The template's path.
$directory_name(string)
The template's directory name.
Default: 'block-templates'

Code of BlockTemplateUtils::generate_template_slug_from_path() WC 6.1.0

public static function generate_template_slug_from_path( $path, $directory_name = 'block-templates' ) {
	return substr(
		$path,
		strpos( $path, $directory_name . DIRECTORY_SEPARATOR ) + 1 + strlen( $directory_name ),
		-5
	);
}