Download the PHP package zikula/hook-bundle without Composer

On this page you can find all versions of the php package zikula/hook-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package hook-bundle

HookBundle

This is a read-only repository.

Resources

What Are Hooks?

How are HookEvents different from standard Events?

Installation

HookEvent Types

The following abstractHookEvents are provided by HookBundle. Additional HookEvents can be easily created as well. Each HookEvent also has a companion HookEventListener that is uniquely paired with that event. This pairing defines the contract between Event and Listener.

  1. DisplayHookEvent -> DisplayHookEventListener
  2. FilterHookEvent -> FilterHookEventListener
  3. FormHookEvent -> FormHookEventListener

DisplayHookEvent

A DisplayHookEvent is dispatched from within a twig template using the provided twig function {{ dispatchDisplayHookEvent('HookEventClassname', 'id') }} DisplayHookEventListeners must add DisplayHookEventResponse objects which add content to the template at that location. (Example: display comments following a blog article).

FilterHookEvent

A FilterHookEvent is dispatched from withing a twig template using the provided twig filter {{ targetString|dispatchFilterHookEvent('HookEventClassname') }} FilterHookEventListeners are provided the target string and this string may be altered (or filtered) as needed. (Example: profanity removal).

FormHookEvent

A FormHookEvent is dispatched twice within a Symfony Form workflow inside a controller. First, after the instantiation of the form and then again after the form has been submitted and validated. FormHookEventListeners are provided the target Form and may alter the Form as needed, provide additional templates and then finally process the unbound form data. (Example: adding profile fields to a user registration form, or adding a WYSIWYG editor to textfields).

Implementation

It is quite easy to implement both HookEvents and HookEventListeners. Simply extend the abstract parent class, defining both title and info properties. It is important that the classes are in an auto-configured directory or are manually tagged zikula.hook_event or zikula.hook_event_listener respectively.

Listeners require implementing logic needed to affect change as desired. In the DisplayHookEventListener and FilterHookEventListener, this is done in the execute method. In FormHookEventListener two methods require logic: preHandleExecute for modifying the form before it handles the Request and postSubmitExecute after the form has been submitted. See all the properties and methods of each class as well as included demonstration code for more information.

Philosophy

Hook Connections are intentionally generic and agnostic of the larger application or specific functions surrounding them. Listeners are unaware of the specific controller or template to which they are listening and the content or form to which they may be connected. The listener does not change its behavior/response based upon which controller or template from which the event is dispatched.

This is one aspect of Hooks that makes them unique from Events. If specific knowledge of the workflow or content is required, a custom event is the preferred solution. Instead, HookListeners respond in a generic way to unique HookEvents and provide the same responses anytime that a HookEvent is dispatched. These Listeners can provide the same responses in any location within an application in this generic way.

The contract is based upon the abstract parent HookEvent class not upon the final concrete class. The final concrete classname becomes the unique event name so that the Connections User Interface may identify the location to assign that connection. This is what is meant by generic contract: generic by HookEvent, and the power is in the flexibility this standardization brings.


All versions of hook-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2.5
symfony/contracts Version ^2.3
symfony/form Version ^5.4
symfony/framework-bundle Version ^5.4
symfony/security-bundle Version ^5.4
symfony/string Version ^5.4
symfony/validator Version ^5.4
zikula/core-bundle Version 3.1.0
zikula/extensions-module Version 3.1.0
zikula/permissions-module Version 3.1.0
zikula/theme-module Version 3.1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package zikula/hook-bundle contains the following files

Loading the files please wait ....