aplia/swark

Collection of must have template operators for eZ publish legacy

Installs: 877

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 5

Forks: 0

Open Issues: 0

Type:ezpublish-legacy-extension

v1.3.2 2021-03-14 11:03 UTC

README

A collection of must have template operators and workflow events for eZ publish legacy.

The code is based on the Seeds Consulting version which was hosted on project.ez.no. It has been extended with new template operators and a simplified way to register new template operators, and has additionally been transformed into a proper Composer package.

Latest Stable Version Minimum PHP Version

Installation

Install with Composer:

composer require aplia/swark

Documentation

An overview of all the template operators and workflow events, as well as detailed instructions for creating new operators can be read at https://swark.readthedocs.io/

Creating new operators

The gist of creating a new template operator is registering it in swark.ini and then creating a PHP class which inherits from SwarkOperator.

More details can be found in the documentation.

For instance to expose phpinfo one would do:

swark.ini:

OperatorMap[phpinfo]=MyProject\PhpInfoOperator

MyProject/PhpInfoOperator.php:

<?php
namespace MyProject;

use SwarkOperator;

class PhpInfoOperator extends SwarkOperator
{
    function __construct()
    {
        parent::__construct('phpinfo');
    }

    static function execute($operatorValue, $namedParameters)
    {
        phpinfo();
    }
}

Then use it in a template with:

{phpinfo()}

Contributors

This code was originally written by Jan Kudlicka and has been extended by developers at Aplia AS. A detailed list of contributors can be found at https://github.com/Aplia/swark/graphs/contributors

License

GNU General Public License v2