Hi Ive been trying to create a shopping cart via php. To do this I have been using the Slim 3 Framework, however I've run into some error and I can't seem to understand what the issue is. Any help is appreciated, thanks!
routes.php
The error seems to be with the syntax of the get function below.
<?php
$app->get('/', ['Cart\Controllers\HomeController', 'index'])->setName('home');
?>
Container.php
use Slim\Views\Twig;
use Slim\Views\TwigExtension;
use Interop\Container\ContainerInterface;
use function DI\get;
return [
'router' => get(Slim\Router::class),
Twig::class => function (ContainerInterface $c)
{
$twig = new Twig(__DIR__ . '/../resources/views', [
'catche' => false
]);
$twig->addExtension(new TwigExtension(
$c->get('router'),
$c->get('request')->getUri()
));
return $twig;
}
];
?>