Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. KernelInterface.php

function KernelInterface::locateResource

Returns the file path for a given bundle resource.

A Resource can be a file or a directory.

The resource name must follow the following pattern:

"@BundleName/path/to/a/file.something"

where BundleName is the name of the bundle and the remaining part is the relative path in the bundle.

Throws

\InvalidArgumentException if the file cannot be found or the name is not valid

\RuntimeException if the name contains invalid/unsafe characters

1 method overrides KernelInterface::locateResource()
Kernel::locateResource in vendor/symfony/http-kernel/Kernel.php
Returns the file path for a given bundle resource.

File

vendor/symfony/http-kernel/KernelInterface.php, line 86

Class

KernelInterface
The Kernel is the heart of the Symfony system.

Namespace

Symfony\Component\HttpKernel

Code

public function locateResource(string $name) : string;
RSS feed
Powered by Drupal