Closed deivibub closed 2 years ago
Class loading may be incorrectly configured, your PageController's namespace may be incorrect (case sensitivity may apply) or there may be a typo in the class name or file. You should be able to check this by debugging class_exists($yourPageControllerClassName)
somewhere else, which would verify if class loading works.
Thank you @NamelessCoder
I checked inside an action of the ContentController and it returned true.
I'm using my provider since flux version 8.2.1 with fluidcontent and fluidpages installed as well (that time). Could there be a migration issue, something I've overseen?
Thank you
I've also experienced some problems. I also noticed neither the "myAction" nor the "initializeAction" methods are invoked. But if you simply need to add some Variables, try overriding like this:
<?php
namespace TYPOworx\FooBar\Controller;
use FluidTYPO3\Flux\Controller\PageController as FluxPageController;
/**
* Class PageController
* @package TYPOworx\FooBar\Controller
* @route off
*/
class PageController extends FluxPageController
{
use ContentDataProcessorTrait;
protected function initializeViewVariables()
{
parent::initializeViewVariables();
this->view->assign('foo', 'bar'); // modify to your needs
}
}
I think this problem was solved with commit https://github.com/FluidTYPO3/flux/commit/19279684f1792f373d3a1fafdbde4dea0e4e12d9 (currently only in the development
branch) - but it would be great if you could confirm!
Side note: if you need specific variables within your templates this can also be done by creating a ViewHelper that reads the variables and assigns them into the VariableProvider
via RenderingContext
, e.g.:
$renderingContext->getVariableProvider()->add('myvariable', 'myvalue');
Or if a ViewHelper already exists which returns the right variable, the output of such a ViewHelper can be assigned as a template variable through this Fluid syntax:
{my:variableViewHelper() -> f:variable(name: 'myvariable')}
Closing as "part unexplained, part solved, part by-design and has workarounds".
For anyone interested:
\FluidTYPO3\Flux\Controller\AbstractFluxController::performSubRendering
contains the business logic that detects if a custom controller should be called.\FluidTYPO3\Flux\Controller\AbstractFluxController::callSubControllerAction
invokes the action method on the custom controller, if it exists.\TYPO3\CMS\Extbase\Mvc\Controller\ActionController::processRequest
is called to render the action on the controller, which is the same way a vanilla controller would be executed - this method should trigger any custom initialize*
methods that your controller contains but note that the composition of this method differes slightly on the supported versions of TYPO3. The short version is: anything that works in a vanilla controller in terms of initialize methods should work identically in a Flux-enabled controller.
Hi there,
I'm using TYPO3 10.4.9 with flux 9.4.2 and registered the controllers
ContentController actions get invoked corresponding to the names of the template files, but having a page template with the name "Standard.html" an action called "standardAction" never gets invoked.
Am I missing something here?
Thank you