Skip to content
/ swark Public

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

License

Notifications You must be signed in to change notification settings

Aplia/swark

Folders and files

NameName
Last commit message
Last commit date
Feb 26, 2020
Mar 14, 2021
Apr 13, 2010
Mar 14, 2021
Apr 13, 2010
Jan 7, 2021
Aug 23, 2016
Jan 6, 2020
Dec 20, 2019
Oct 25, 2016
Apr 13, 2010
Jul 30, 2020
Feb 21, 2020

Repository files navigation

Swark

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