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.
Install with Composer:
composer require aplia/swark
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/
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()}
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
GNU General Public License v2