Last active
June 7, 2019 06:26
-
-
Save mficzel/1b83b7b804f918b0b485d5e405100112 to your computer and use it in GitHub Desktop.
Backend Module with Fusion-AFX
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 Test\BeModule\Controller; | |
use Neos\Flow\Annotations as Flow; | |
use Neos\Flow\Mvc\View\ViewInterface; | |
use Neos\Fusion\View\FusionView; | |
use Neos\Neos\Controller\Module\AbstractModuleController; | |
class ExampleController extends AbstractModuleController | |
{ | |
/** | |
* @var FusionView | |
*/ | |
protected $view; | |
/** | |
* @var string | |
*/ | |
protected $defaultViewObjectName = FusionView::class; | |
public function indexAction() | |
{ | |
$this->view->assignMultiple([ | |
'foo' => 'bar' | |
]); | |
$this->view->setFusionPath('test'); | |
} | |
/** | |
* Sets the Fusion path pattern on the view. | |
* | |
* @param ViewInterface $view | |
* @return void | |
*/ | |
protected function initializeView(ViewInterface $view) | |
{ | |
parent::initializeView($view); | |
$view->setFusionPathPattern('resource://Test.BeModule/Private/Fusion'); | |
} | |
} |
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
privilegeTargets: | |
'Neos\Flow\Security\Authorization\Privilege\Method\MethodPrivilege': | |
'Test.BeModule:ModuleAccess': | |
matcher: 'method(Test\BeModule\Controller\ExampleController->(index)Action())' | |
roles: | |
'Neos.Neos:AbstractEditor': | |
privileges: | |
- | |
privilegeTarget: 'Test.BeModule:ModuleAccess' | |
permission: GRANT |
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
include: resource://Neos.Fusion/Private/Fusion/Root.fusion | |
test = afx` | |
<h1>Hello World</h1> | |
` |
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
Neos: | |
Flow: | |
mvc: | |
routes: | |
'Test.BeModule': true | |
Neos: | |
modules: | |
management: | |
submodules: | |
example: | |
controller: \Test\BeModule\Controller\ExampleController | |
label: 'Example' | |
description: '' | |
icon: 'fas fa-camera' | |
privilegeTarget: 'Test.BeModule:ModuleAccess' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment