Download the PHP package afbora/kirby-template-hooks without Composer

On this page you can find all versions of the php package afbora/kirby-template-hooks. 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 kirby-template-hooks

Kirby Template Hooks

Kirby template hooks allow you to manage hooks for page and file templates and user roles more easily.

Instead of checking the template in every page.update:after hook, you can register a hook only for the pages with the product template: page.product.update:after.

Requirements

For Kirby 3 and 4, use version 1.x.

Installation

Installation with composer

Add as git submodule

Usage

Pages

Usage: page.TEMPLATE_NAME.ACTION_NAME:before/after

The template name is the intended template of the page, i.e. the name of its content file (product.txt).

Files

Usage: file.TEMPLATE_NAME.ACTION_NAME:before/after

The template name is the template field of the file. Files without a template use default, like their files/default blueprint:

User avatars are files with the avatar template, so file.avatar.create:after runs for new avatars.

Users

Usage: user.ROLE_NAME.ACTION_NAME:before/after

Arguments

Template hooks receive exactly the same arguments as the core hooks, e.g. $page, $values, $strings and $languageCode for page.update:before. You can find them in the hooks reference. The $event argument is the template event (page.product.update:after).

Like core hooks, template hooks can return a modified model to change the result of the action:

Actions

Type Actions
page changeNum, changeSlug, changeStatus, changeTemplate, changeTitle, create, delete, duplicate, move, update
file changeName, changeSort, changeTemplate, create, delete, replace, update
user changeEmail, changeLanguage, changeName, changePassword, changeRole, changeSecret (Kirby 6), changeTotp (Kirby 5), create, createAvatar (Kirby 5.4+), delete, deleteAvatar (Kirby 5.4+), replaceAvatar (Kirby 5.4+), update

changeTemplate and changeRole run the before hook for the old template or role and the after hook for the new one:

Upgrading from 1.x


All versions of kirby-template-hooks with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
getkirby/composer-installer Version ^1.2
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 afbora/kirby-template-hooks contains the following files

Loading the files please wait ...