I try with single quotes and nothing, continue with same error.
I’m stay debugging and I see in /vendor/slim/php-view/src/PhpRenderer.php in line 153 this:
if (!is_file($this->templatePath . $template)) {
throw new \RuntimeException("View cannot render `$template` because the template does not exist");
}
The problem is that $this->templatePath . $template is this ‘’…/templates/ticketadd.phtml" and the is_file function return false, so !false its true and throw that exception.
I think it is because you used "./templates" instead of ../templates/. It seems ./templates is correct, which is strange because index.php is in /public
You can use __DIR__ for a path relative to the directory of the current file, so you point to a directory regardless of the current directory of the main PHP script. If you use
$container['view'] = new \Slim\Views\PhpRenderer(__DIR__ . '/../templates/');
in project/public/index.php, then it should correctly point to the /project/templates/ directory.