ContainerUtil
in package
Class ContainerUtil.
use utils service instead
Table of Contents
Properties
- $container : ContainerInterface
- $utils : Utils
Methods
- __construct() : mixed
- getActiveBundles() : array<string|int, mixed>
- Returns the active bundles.
- getBundlePath() : bool|string
- Returns the path to the bundle in vendor folder Attention: resolves symlinks!
- getBundleResourcePath() : bool|string|array<string|int, mixed>
- Returns the path or paths to a ressource within a bundle Attention: resolves symlinks!
- getCurrentRequest() : mixed
- getProjectDir() : mixed
- Returns the project root path.
- getWebDir() : mixed
- Returns the web folder path.
- isBackend() : bool
- isBundleActive() : bool
- Checks if some bundle is active. Pass in the class name (e.g. 'HeimrichHannot\FilterBundle\HeimrichHannotContaoFilterBundle' or the legacy Contao 3 name like 'news').
- isDev() : bool
- isFrontend() : bool
- isFrontendCron() : bool
- isInstall() : bool
- isMaintenanceModeActive() : bool
- isPreviewMode() : bool
- log() : mixed
- mergeConfigFile() : array<string|int, mixed>
- Recursively merges a config.yml with a $extensionConfigs array in the context of ExtensionPluginInterface::getExtensionConfig().
Properties
$container
protected
ContainerInterface
$container
$utils
protected
Utils
$utils
Methods
__construct()
public
__construct(ContainerInterface $container, Utils $utils) : mixed
Parameters
- $container : ContainerInterface
- $utils : Utils
getActiveBundles()
Returns the active bundles.
public
getActiveBundles() : array<string|int, mixed>
Use kernel.bundles parameter or KernelInterface::getBundles()
Tags
Return values
array<string|int, mixed>getBundlePath()
Returns the path to the bundle in vendor folder Attention: resolves symlinks!
public
getBundlePath(string $bundleClass) : bool|string
Use utils service instead
Parameters
- $bundleClass : string
-
The bundle class class constant (VendorMyBundle::class)
Tags
Return values
bool|string —False on error
getBundleResourcePath()
Returns the path or paths to a ressource within a bundle Attention: resolves symlinks!
public
getBundleResourcePath(string $bundleClass[, string $ressourcePath = '' ][, bool $first = false ]) : bool|string|array<string|int, mixed>
Use utils service instead
Parameters
- $bundleClass : string
-
The bundle class class constant (VendorMyBundle::class)
- $ressourcePath : string = ''
-
a ressource or path to ressource
- $first : bool = false
-
Returns only first occurrence if multiple paths found
Tags
Return values
bool|string|array<string|int, mixed> —False on error
getCurrentRequest()
public
getCurrentRequest() : mixed
Use RequestStack::getCurrentRequest() instead
Tags
getProjectDir()
Returns the project root path.
public
getProjectDir() : mixed
Use KernelInterface::getProjectDir or kernel.project_dir parameter
Tags
getWebDir()
Returns the web folder path.
public
getWebDir() : mixed
Use contao.web_dir parameter
Tags
isBackend()
public
isBackend() : bool
Use utils service instead
Tags
Return values
boolisBundleActive()
Checks if some bundle is active. Pass in the class name (e.g. 'HeimrichHannot\FilterBundle\HeimrichHannotContaoFilterBundle' or the legacy Contao 3 name like 'news').
public
isBundleActive(string $bundleName) : bool
Use utils service instead
Parameters
- $bundleName : string
Tags
Return values
boolisDev()
public
isDev() : bool
Use utils service instead
Tags
Return values
boolisFrontend()
public
isFrontend() : bool
Use utils service instead
Tags
Return values
boolisFrontendCron()
public
isFrontendCron() : bool
Use utils service instead
Tags
Return values
boolisInstall()
public
isInstall() : bool
Use utils service instead
Tags
Return values
boolisMaintenanceModeActive()
public
isMaintenanceModeActive() : bool
Use utils service instead
Tags
Return values
boolisPreviewMode()
public
isPreviewMode() : bool
Use utils service instead
Tags
Return values
boollog()
public
log(string $text, string $function, string $category) : mixed
Use utils service instead
Parameters
- $text : string
- $function : string
- $category : string
-
Use constants in ContaoContext
Tags
mergeConfigFile()
Recursively merges a config.yml with a $extensionConfigs array in the context of ExtensionPluginInterface::getExtensionConfig().
public
static mergeConfigFile(string $activeExtensionName, string $extensionName, array<string|int, mixed> $extensionConfigs, string $configFile) : array<string|int, mixed>
Use ConfigPluginInterface with class_exist instead
Must be static, because on Plugin::getExtensionConfig() no contao.framework nor service huh.utils.container is available.
Parameters
- $activeExtensionName : string
- $extensionName : string
- $extensionConfigs : array<string|int, mixed>
- $configFile : string