Create a Macro


Create a new file /application/macros/randomx.php

Insert the code:

namespace Macros;
use Component\Streams\Model\BaseStream;
use Component\Clicks\Model\RawClick;
use Component\Macros\AbstractClickMacro;
class randomx extends AbstractClickMacro
    public function process(BaseStream $stream, RawClick $rawClick, $min, $max)
        return rand($min, $max);

The class name must be the same as file name.

You can pass parameters from the macro:


$min = 100, $max = 999.

Read about objects $stream and $rawClick on page Internals.