Hi,
im trying to use an action of a controller with f:link.action
. The controller does nothing special i’m just trying to understand how this works. My problem is, that the routing fails although the error log contains the correct values.
The Controller:
<?php
namespace My\Package\Controller;
use Neos\Flow\Annotations as Flow;
use Neos\Flow\Mvc\Controller\ActionController;
class MyController extends ActionController
{
/**
* @return void
*/
public function showAction()
{
$this->view->assign('foo', 'bar');
}
}
Routes.yaml
-
name: 'Route for my controller'
uriPattern: 'my/package/mycontroller/{@action}'
defaults:
'@package': 'My.Package'
'@controller': 'MyController'
'@format': 'html'
Fluid
<f:link.action action="show" package="My.Package" controller="MyController">some link</f:link.action>
<!-- Another attempt with a create action and a form (the createAction function in the controller is the same as the showAction)-->
<f:form class="ui reply form" action="create" controller="MyController" package="My.Package" id="myForm">
. . .
</form>
The error messages in two log files:
System_Development.log
7-03-12 23:36:26 2310 DEBUG Flow CSRF: No token required, safe request
17-03-12 23:36:26 2310 WARNING Flow Router resolve(): Could not resolve a route for building an URI for the given route values.
@action => show
@controller => mycontroller
@package => my.package
17-03-12 23:36:26 2310 CRITICAL FluidAdaptor Exception #1301610453: Could not resolve a route and its corresponding URI for the given parameters. This may be due to referring to a not existing package / controller / action while building a link or URI. Refer to log and check the backtrace for more details. - See also: 2017031223362635df06.txt
2017031223362635df06.txt
Exception #1301610453: Could not resolve a route and its corresponding URI for the given parameters. This may be due to referring to a not existing package / controller / action while building a link or URI. Refer to log and check the backtrace for more details.
119 Neos\FluidAdaptor\ViewHelpers\Link\ActionViewHelper_Original::render(“show”, array|0|, “MyController”, “My.Package”, NULL, “”, “”, array|0|, FALSE, array|0|, FALSE, TRUE, FALSE)
118 call_user_func_array(array|2|, array|13|)
. . .
I’m certainly missing something but I’m really confused since the error logs contain the correct package / controller / action identifier. What is the problem here?