Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

league/plates v4.0.0-alpha to v3.4.0 create error #295

Open
tiagocaus opened this issue Jun 19, 2022 · 3 comments
Open

league/plates v4.0.0-alpha to v3.4.0 create error #295

tiagocaus opened this issue Jun 19, 2022 · 3 comments

Comments

@tiagocaus
Copy link

Hello, I'm downgrading league/plates from v4.0.0-alpha to v3.4.0, because this version supports PHP 8.

When making this change I'm having a problem with this create:

IMG: https://i.imgur.com/fnsrTGz.png

How to fix it?

Code v4.0.0-alpha:

<?php

namespace App\Controllers;

use League\Plates\Engine;

class Panel
{
    private $view;
    public function __construct()
    {
        $this->view = Engine::create(__DIR__ . "/../Views/", "php");
    }

    public function login(): void
    {
        echo $this->view->render("login", [
            "title" => "Login"
        ]);
    }

    public function error(array $data): void
    {
        echo "<h1>Error {$data["errcode"]}</h1>";
    }
}
@raphaelterre
Copy link

Tiago, estou tendo o mesmo problema. Conseguiu alguma solução?

@tiagocaus
Copy link
Author

@raphaelterre ainda não, caso consiga, compartilhe aqui.

@alan-5151
Copy link

alan-5151 commented Aug 18, 2022

Também tive o mesmo problema, creio que este projeto (plates) esteja abandonado.

A solução que encontrei utilizando a versão 3.4:

Substituir a instrução: Engine::create('/path/to/templates'); por: Engine('/path/to/templates');

Istó é. ignorar a função create().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants