Download the PHP package bitpatroon/typo3_hooks without Composer
On this page you can find all versions of the php package bitpatroon/typo3_hooks. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download bitpatroon/typo3_hooks
More information about bitpatroon/typo3_hooks
Files in bitpatroon/typo3_hooks
Download bitpatroon/typo3_hooks
More information about bitpatroon/typo3_hooks
Files in bitpatroon/typo3_hooks
Vendor bitpatroon
Package typo3_hooks
Short Description Extension to easily add hooks in your own code.
License GPL-2.0-or-later
Package typo3_hooks
Short Description Extension to easily add hooks in your own code.
License GPL-2.0-or-later
Please rate this library. Is it a good library?
Informations about the package typo3_hooks
typo3_hooks
Hooks mechanism for TYPO3
Usage:
processHook
To call a hook, simple add the following code in any class of your code.
\Bitpatroon\Typo3Hooks\Helpers\HooksHelper::processHook(<class>, <hookname>, [<params>]);
- Class (I) can be the instance, the static reference or the classname i.e.
- $this
- self
- \VENDOR\CALLING_HOOK_CLASS::class
- Hookname (II) is the name of the hook is the hook,
- Params (III) is a y reference passed array with values for the hook.
Register the hook
In your or any localconf.php, add the hook.
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][\VENDOR\CALLING_HOOK_CLASS::class] = [
'className' => \VENDOR\CALLED_CLASS::class
];
- CALLING_HOOK_CLASS is the name of the class, as specified in (I).
- CALLED_CLASS is the name of the class, handling the hook
The class with the hook
Add a TYPO3 class CALLED_CLASS with the following code.
namespace VENDOR;
class CALLED_CLASS
/**
* Hook
* @param array $params The parameter Array
* @param object $ref The parent object
*/
public function MyHook(&$params, $ref)
{
}
}
Notice the $params is by reference. Changing the content affects the original array. $ref is the calling class. See (I).
Notice: Don't forget to reset the cache!
All versions of typo3_hooks with dependencies
PHP Build Version
Package Version
Requires
typo3/cms-core Version
>=7.6.0 < 10.9.99
The package bitpatroon/typo3_hooks contains the following files
Loading the files please wait ...