Constructor in block controller called 3 times

Hi, when i add the code belowe it is called 3 times, what am i doing wrong?

public function __construct(){
echo ‘constructor’;
}

Try

public function on_start() {}

or

public function on_before_render() {}

Don’t remember right now, if construct is triggered multiple time during block initialization, but those should run only once.

1 Like

Great, that works! Thanks

1 Like