Created
November 21, 2019 12:07
-
-
Save mficzel/4c8af492bcfa3d5536ddc09caac8ea6c to your computer and use it in GitHub Desktop.
Using the Fusion View in a Backend Module
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php´ | |
namespace Vendor\Site\Controller; | |
use Neos\Flow\Annotations as Flow; | |
use Neos\Neos\Controller\Module\AbstractModuleController; | |
use Neos\Fusion\View\FusionView; | |
class FusionController extends AbstractModuleController | |
{ | |
/** | |
* tell the controller to use the fusion view | |
*/ | |
protected $defaultViewObjectName = FusionView::class; | |
public function indexAction(): void | |
{ | |
$this->view->assign('example', 'some value to assign as example'); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# require the fusion from other packages | |
include: resource://Neos.Fusion/Private/Fusion/Root.fusion | |
include: resource://Neos.Fusion.Form/Private/Fusion/Root.fusion | |
# assign the controller pathes to prototypes | |
Vendor.Site.FusionController.index = Vendor.Site:Example | |
# ofcourse yopu can define the renderer directly on the path aswell | |
Vendor.Site.FusionController.other = Vendor.Site:Example | |
# define the actual rendering prototype | |
prototype(Vendor.Site:Example) < prototype(Neos.Fusion:Component) { | |
renderer = afx` | |
<h2>Here comes the {example}</h2> | |
` | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment