Closed jeremyzahner closed 9 years ago
Okay, another guess.
Do i need to somehow pass $headline and $bottomline in any case? Because right now it only gets passed by the shortcode, not by the route.
So as far as i can see, there is some sort of conflict when using the same Controller for either shortcodes or routes. At least when passing arguments. For me this is resolved. But of course it might get in the way when writing DRY code. =)
@jeremyzahner you're requesting two required variables that the router doesn't know how to provide. Try making them default as null instead. That should solve your issue.
/**
* Create a new beer label view.
*/
public function createScreen($headline = null, $bottomline = null, Http $http)
{
$headline = $headline ?: 'BEER';
$bottomline = $bottomline ?: 'AMBER';
if (!isset($imageurl)) $imageurl = Helper::assetUrl('/stich.png');
return view('@BierEtikettenGenerator/generator/generator_screen.twig', [
'headline' => $headline,
'bottomline' => $bottomline,
'labelsvg_file' => Helper::assetUrl('/beer_etikette_web.svg'),
'bgimage_file' => $imageurl
]);
}
Sorted out. Thank you!
Hi there
Im currently stuck at a problem i just somehow can not manage to resolve.
I have a function inside my controller which basically returns a twig view.
Then again i use a route AND a shortcode to access the exact same controller function.
Route:
Shortcode:
Every time i try to access it it says:
Actually it does it only if i access it by the direct route. If i get it from the shortcode it seems to work just fine. Also changing the amount of arguments does not make a difference.
My first guess: Twig Cache.