CRM_Core_Resources_Common
in package
Define some common, global lists of resources.
Table of Contents
Constants
- REGION = 'html-header'
Methods
- createBasicBundle() : CRM_Core_Resources_Bundle
- Create a "basic" (generic) bundle.
- createBootstrap3Bundle() : CRM_Core_Resources_Bundle
- The 'bundle.bootstrap3' service is a collection of resources which are loaded when a page needs to support Boostrap CSS v3.
- createFullBundle() : CRM_Core_Resources_Bundle
- The 'bundle.coreResources' service is a collection of resources shared by Civi pages (ie pages where Civi controls rendering).
- createStyleBundle() : CRM_Core_Resources_Bundle
- The 'bundle.coreStyles' service is a collection of resources used on some non-Civi pages (wherein Civi may be mixed-in).
- coreResourceList() : array<string|int, mixed>
- List of core resources we add to every CiviCRM page.
Constants
REGION
public
mixed
REGION
= 'html-header'
Methods
createBasicBundle()
Create a "basic" (generic) bundle.
public
static createBasicBundle(string $name[, callable|null $init = NULL ][, string|array<string|int, string> $types = NULL ]) : CRM_Core_Resources_Bundle
The bundle goes through some lifecycle events (like hook_alterBundle
).
To define default content for a basic bundle, you may either give an
$init
function or subscribe to hook_alterBundle
.
Parameters
- $name : string
-
Symbolic name of the bundle.
- $init : callable|null = NULL
-
Optional initialization function. Populate default resources. Signature:
function($bundle): void
Example:function myinit($b) { $b->addScriptFile(...)->addStyleFile(...); }
- $types : string|array<string|int, string> = NULL
-
List of resource-types to permit in this bundle. NULL for a default list. Example: ['styleFile', 'styleUrl'] The following aliases are allowed: 'all', 'default', 'script', 'style'
Return values
CRM_Core_Resources_BundlecreateBootstrap3Bundle()
The 'bundle.bootstrap3' service is a collection of resources which are loaded when a page needs to support Boostrap CSS v3.
public
static createBootstrap3Bundle(string $name) : CRM_Core_Resources_Bundle
Parameters
- $name : string
-
i.e. 'bootstrap3'
Return values
CRM_Core_Resources_BundlecreateFullBundle()
The 'bundle.coreResources' service is a collection of resources shared by Civi pages (ie pages where Civi controls rendering).
public
static createFullBundle(string $name) : CRM_Core_Resources_Bundle
Parameters
- $name : string
-
i.e. 'coreResources'
Tags
Return values
CRM_Core_Resources_BundlecreateStyleBundle()
The 'bundle.coreStyles' service is a collection of resources used on some non-Civi pages (wherein Civi may be mixed-in).
public
static createStyleBundle(string $name) : CRM_Core_Resources_Bundle
Parameters
- $name : string
-
i.e. 'coreStyles'
Tags
Return values
CRM_Core_Resources_BundlecoreResourceList()
List of core resources we add to every CiviCRM page.
protected
static coreResourceList(string $region) : array<string|int, mixed>
Note: non-compressed versions of .min files will be used in debug mode
Parameters
- $region : string