Contao Utils Bundle

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

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
codeCoverageIgnore
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
codeCoverageIgnore
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
codeCoverageIgnore
Return values
bool|string|array<string|int, mixed>

False on error

getCurrentRequest()

public getCurrentRequest() : mixed

Use RequestStack::getCurrentRequest() instead

Tags
codeCoverageIgnore

getProjectDir()

Returns the project root path.

public getProjectDir() : mixed

Use KernelInterface::getProjectDir or kernel.project_dir parameter

Tags
codeCoverageIgnore

getWebDir()

Returns the web folder path.

public getWebDir() : mixed

Use contao.web_dir parameter

Tags
codeCoverageIgnore

isBackend()

public isBackend() : bool

Use utils service instead

Tags
codeCoverageIgnore
Return values
bool

isBundleActive()

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
codeCoverageIgnore
Return values
bool

isDev()

public isDev() : bool

Use utils service instead

Tags
codeCoverageIgnore
Return values
bool

isFrontend()

public isFrontend() : bool

Use utils service instead

Tags
codeCoverageIgnore
Return values
bool

isFrontendCron()

public isFrontendCron() : bool

Use utils service instead

Tags
codeCoverageIgnore
Return values
bool

isInstall()

public isInstall() : bool

Use utils service instead

Tags
codeCoverageIgnore
Return values
bool

isMaintenanceModeActive()

public isMaintenanceModeActive() : bool

Use utils service instead

Tags
codeCoverageIgnore
Return values
bool

isPreviewMode()

public isPreviewMode() : bool

Use utils service instead

Tags
codeCoverageIgnore
Return values
bool

log()

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
codeCoverageIgnore

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
Tags
codeCoverageIgnore
Return values
array<string|int, mixed>

        
On this page

Search results