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

Slim Application Error #13

Open
marlevek opened this issue Jun 18, 2020 · 4 comments
Open

Slim Application Error #13

marlevek opened this issue Jun 18, 2020 · 4 comments

Comments

@marlevek
Copy link

Olá, faço o curso php 7 completo pela udemy e não estou conseguindo avançar no curso, Volta e meia dá erro. E escrevo o código igual ao da aula, então se puder ajudar agradeço.
Agora deu esse erro:
Slim Application Error
The application could not run because of the following error:

Details
Message: Template header not found!
File: C:\XAMPP\htdocs\Ecommerce\vendor\rain\raintpl\library\Rain\Tpl.php
Line: 191
Trace
#0 C:\XAMPP\htdocs\Ecommerce\vendor\rain\raintpl\library\Rain\Tpl.php(79): Rain\Tpl->checkTemplate('header')
#1 C:\XAMPP\htdocs\Ecommerce\vendor\hcodebr\php-classes\src\Page.php(32): Rain\Tpl->draw('header')
#2 C:\XAMPP\htdocs\Ecommerce\index.php(14): Hcode\Page->__construct()
#3 [internal function]: {closure}()
#4 C:\XAMPP\htdocs\Ecommerce\vendor\slim\slim\Slim\Router.php(200): call_user_func_array(Object(Closure), Array)
#5 C:\XAMPP\htdocs\Ecommerce\vendor\slim\slim\Slim\Slim.php(1210): Slim\Router->dispatch(Object(Slim\Route))
#6 C:\XAMPP\htdocs\Ecommerce\vendor\slim\slim\Slim\Middleware\Flash.php(86): Slim\Slim->call()
#7 C:\XAMPP\htdocs\Ecommerce\vendor\slim\slim\Slim\Middleware\MethodOverride.php(94): Slim\Middleware\Flash->call()
#8 C:\XAMPP\htdocs\Ecommerce\vendor\slim\slim\Slim\Middleware\PrettyExceptions.php(67): Slim\Middleware\MethodOverride->call()
#9 C:\XAMPP\htdocs\Ecommerce\vendor\slim\slim\Slim\Slim.php(1159): Slim\Middleware\PrettyExceptions->call()
#10 C:\XAMPP\htdocs\Ecommerce\index.php(18): Slim\Slim->run()
#11 {main}

Segue arquivos php para olharem:

[] ]; public function __construct($opts = array()) { $this->options = array_merge($this->defaults, $opts); $config = array( "tpl_dir" => $_SERVER["DOCUMENT_ROOT"] . "/views/", "cache_dir" => $_SERVER["DOCUMENT_ROOT"] . "/views-cache/", "debug" => false // set to false to improve the speed ); Tpl::configure($config); $this->tpl = new Tpl; $this->setData($this->options["data"]); $this->tpl->draw("header"); } private function setData($data = array()) { foreach ($data as $key => $value) { $this->tpl->assign($key, $value); } } public function setTpl($name, $data = array(), $returnHTML = false) { $this->setData($data); return $this->tpl->draw($name, $returnHTML); } public function __destruct() { $this->tpl->draw("footer"); } } e INDEX.PHP: config('debug', true); $app->get('/', function () { $page = new Page(); $page->setTpl("index"); }); $app->run(); Obrigado
@hog099
Copy link

hog099 commented Jun 18, 2020

Bom Dia, Nobre

Sendo bem franco, não me recordo muito bem do projeto, mas pela mensagem ali referente "template header", a importação dos templates são em partes estruturadas, deve ter algum erro em alguma linha na importação do header, da uma revisada nessa parte.

@marlevek
Copy link
Author

marlevek commented Jun 18, 2020 via email

@hog099
Copy link

hog099 commented Jun 18, 2020

Os tutores, responderam as issues dentro da plataforma la?
la tbm tem uma busca de situações deve estar mais facil.

deixa o github do seu projeto aqui, tendo um tempo dou uma olhada

@marlevek
Copy link
Author

marlevek commented Jun 18, 2020 via email

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

2 participants