Documentation

CRM_Core_Invoke
in package

Given an argument list, invoke the appropriate CRM function Serves as a wrapper between the UserFrameWork and Core CRM

Tags
copyright

CiviCRM LLC https://civicrm.org/licensing

Table of Contents

Methods

_invoke()  : string|ResponseInterface
This is the same as invoke(), but it does *not* include exception handling.
form()  : mixed
This function contains the default action.
getItem()  : mixed
Determine which menu $item corresponds to $args
hackMenuRebuild()  : mixed
Hackish support /civicrm/menu/rebuild
init()  : mixed
Perform general setup.
invoke()  : string
This is the main front-controller that integrates with the CMS. Any page-request that is sent to the CMS and intended for CiviCRM should be processed by invoke().
rebuildMenuAndCaches()  : void
runItem()  : string|ResponseInterface
Given a menu item, call the appropriate controller and return the response
statusCheck()  : mixed
Show status in the footer (admin only)
findCallback()  : array<string|int, mixed>
isPsr7Handler()  : bool

Methods

_invoke()

This is the same as invoke(), but it does *not* include exception handling.

public static _invoke(array<string|int, mixed> $args) : string|ResponseInterface
Parameters
$args : array<string|int, mixed>

The parts of the URL which identify the intended CiviCRM page (e.g. array('civicrm', 'event', 'register')).

Return values
string|ResponseInterface

One of the following:

  • string: HTML page-content
  • ResponseInterface, exact content to send as HTTP response
  • exit: invoke() may call print() and exit().

form()

This function contains the default action.

public static form(mixed $action, mixed $contact_type, mixed $contact_sub_type) : mixed

Unused function.

Parameters
$action : mixed
$contact_type : mixed
$contact_sub_type : mixed
Tags
Deprecated

getItem()

Determine which menu $item corresponds to $args

public static getItem(string|array<string|int, string> $args) : mixed
Parameters
$args : string|array<string|int, string>

Path to lookup Ex: 'civicrm/foo/bar' Ex: ['civicrm', 'foo', 'bar']

Tags
@return

array; see CRM_Core_Menu

hackMenuRebuild()

Hackish support /civicrm/menu/rebuild

public static hackMenuRebuild(array<string|int, mixed> $args) : mixed
Parameters
$args : array<string|int, mixed>

List of path parts.

Tags
void

init()

Perform general setup.

public static init(array<string|int, mixed> $args) : mixed
Parameters
$args : array<string|int, mixed>

List of path parts.

Tags
void

invoke()

This is the main front-controller that integrates with the CMS. Any page-request that is sent to the CMS and intended for CiviCRM should be processed by invoke().

public static invoke(array<string|int, mixed> $args) : string
Parameters
$args : array<string|int, mixed>

The parts of the URL which identify the intended CiviCRM page (e.g. array('civicrm', 'event', 'register')).

Return values
string

HTML. For non-HTML content, invoke() may call print() and exit().

rebuildMenuAndCaches()

public static rebuildMenuAndCaches([bool $triggerRebuild = false ][, bool $sessionReset = false ]) : void

Deprecated Feb 2025 in favor of Civi::rebuild(). Reassess after Jun 2026. For an extension bridging before+after, suggest guard like: if (version_compare(CRM_Utils_System::version(), 'X.Y.Z', '>=')) Civi::rebuild(...)->execute() else CRM_Core_Invoke::rebuildMenuAndCaches(); Choose an 'X.Y.Z' after determining that your preferred rebuild-target(s) are specifically available in X.Y.Z.

Parameters
$triggerRebuild : bool = false
$sessionReset : bool = false
Tags
throws
Exception

runItem()

Given a menu item, call the appropriate controller and return the response

public static runItem(array<string|int, mixed> $item) : string|ResponseInterface
Parameters
$item : array<string|int, mixed>

See CRM_Core_Menu.

Tags
throws
CRM_Core_Exception
Return values
string|ResponseInterface

One of the following:

  • string: HTML page-content
  • ResponseInterface, exact content to send as HTTP response
  • exit: invoke() may call print() and exit().

statusCheck()

Show status in the footer (admin only)

public static statusCheck(CRM_Core_Smarty $template) : mixed

If in Maintenance Mode, display a message to user

Parameters
$template : CRM_Core_Smarty

findCallback()

protected static findCallback(array<string|int, mixed> $item) : array<string|int, mixed>
Parameters
$item : array<string|int, mixed>
Tags
throws
CRM_Core_Exception
Return values
array<string|int, mixed>

isPsr7Handler()

private static isPsr7Handler(mixed $callback) : bool
Parameters
$callback : mixed
Return values
bool

        
On this page

Search results