vdlp/oc-redirectconditions-plugin

Allows developers to create their own Redirect Conditions extension plugins for October CMS.

1.3.1 2023-06-12 07:59 UTC

This package is auto-updated.

Last update: 2024-04-14 14:03:04 UTC


README

68747470733a2f2f706c7567696e732e76646c702e6e6c2f6f63746f626572636d732f69636f6e732f56646c702e52656469726563742e737667

Vdlp.RedirectConditions

This plugin allows developers to create their own Redirect conditions.

68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f7068702f76646c702f6f632d7265646972656374636f6e646974696f6e732d706c7567696e 68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f6c6963656e73652f76646c702f6f632d7265646972656374636f6e646974696f6e732d706c7567696e 68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f762f76646c702f6f632d7265646972656374636f6e646974696f6e732d706c7567696e2f6c6174657374 68747470733a2f2f62616467656e2e6e65742f62616467652f636d732f4f63746f626572253230434d53 68747470733a2f2f62616467656e2e6e65742f62616467652f747970652f706c7567696e 68747470733a2f2f706c7567696e732e76646c702e6e6c2f6f63746f626572636d732f62616467652f696e7374616c6c6174696f6e732e7068703f706c7567696e3d76646c702d7265646972656374636f6e646974696f6e73

What is a Redirect Condition?

When a positive match occurs in the redirect engine, all registered redirect conditions will be checked if they pass. If one of the conditions does not pass the redirect will not take place.

A redirect condition must implement RedirectConditionInterface.

Each redirect condition must have:

  • getCode() - A unique code.
  • getDescription() - A short description.
  • getExplanation() - A brief explanation on when or how to use it.
  • getFormConfig() - A form configuration array.
  • passes(RedirectRule $rule, string $requestUri) - Logic whether the condition passes with the given $rule and $requestUri.

Requirements

  • The Vdlp.Redirect plugin.
  • PHP 8.0.2 or higher.
  • October CMS 3.0 or higher.

Example

This plugin contains an detailed implementation example (plugin). This plugin can be found at GitHub.