Using a facade

Edit on GitHub

Using the facade from a controller or a plugin

In Zed’s communication layer the facade of the same module is available with the getFacade() method from all controllers and plugins. image

A typical usage from a controller looks like this. The controller retrieves data from a submitted form and calls a method of a facade to save it.

namespace Pyz\Zed\Glossary\Communication\Controller;

class FormController extends AbstractController
    public function translationAction()
        // ...
        if ($form->isValid()) {
            $translation = new TranslationTransfer();
        // ...

Using a facade from another module

To connect modules you can provide the facade to another module. To do so, you need to use the dependency provider mechanism.