Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mask Hook vs. CLI command #1

Open
fgerards opened this issue Feb 19, 2024 · 1 comment
Open

Mask Hook vs. CLI command #1

fgerards opened this issue Feb 19, 2024 · 1 comment

Comments

@fgerards
Copy link

any chance to get the extension to write out the new typoscript upon saving of a contentelement in the Mask Backend Editor ?

@fgerards
Copy link
Author

fgerards commented Feb 19, 2024

one solution could be, that you register an EventListener to the mask-save Event and exec the cli cmd in it:

<?php

namespace MyVendor\MyExtension\Eventlistener;

use MASK\Mask\Event\MaskAfterElementSavedEvent;
use Symfony\Component\Process\Process;
use TYPO3\CMS\Core\Core\Environment;

class MaskAfterElementSavedEventListener
{
    public function __invoke(MaskAfterElementSavedEvent $event): void
    {
        $process = new Process(['vendor/bin/typo3', 'myextension:generatemaskts']);
        $process->setWorkingDirectory(Environment::getProjectPath());
        $process->run();
    }
}

MyVendor\MyExtension\EventListener\MaskAfterElementSavedEventListener:
    tags:
      - name: event.listener
        identifier: 'executeCodeAfterChange'
        event: MASK\Mask\Event\MaskAfterElementSavedEvent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant