diff --git a/inc/class-blade.php b/inc/class-blade.php index bd2bff2..16ca244 100644 --- a/inc/class-blade.php +++ b/inc/class-blade.php @@ -131,6 +131,17 @@ public static function getFacadeAccessor() { } )::getFacadeAccessor() ); + // Register each path as an anonymous component path with its prefix. + foreach ( $this->paths_to_views as $prefix => $path ) { + // Skip paths without a prefix in the key. + if ( is_numeric( $prefix ) ) { + continue; + } + + // Register the anonymous component path. + $this->blade_compiler->anonymousComponentPath( $path, $prefix ); + } + // Callback function for every view. if ( is_callable( $this->view_callback ) ) { $this->view_factory->composer( '*' , function( $view ) {