Open Srubens opened 6 years ago
Oi Filipe, tudo bem? Esse erro ocorre pois você não carregou os dados do usuário na rota No seu arquivo index.php, deixe a rota "/admin/users/:iduser" desta maneira:
$app->get('/admin/users/:iduser', function($iduser){
User::verifyLogin();
$user = new User();
$user->get((int)$iduser);
$page = new PageAdmin();
$page ->setTpl("users-update", array(
"user"=>$user->getValues()
));
});
Teste e nos diga se funcionou Ficamos no aguardo Bons estudos Anthony Rafael Ribeiro - SUPORTE
Ok consegui obrigado!
Olá, estou fazendo o curso de vocês e estou com o seguinte erro:"Fatal error: Uncaught Error: Class 'Hcode\DB\Sql' not found in D:\e-commerce\index.php:11 Stack trace: #0 [internal function]: {closure}() #1 D:\e-commerce\vendor\slim\slim\Slim\Router.php(200): call_user_func_array(Object(Closure), Array) #2 D:\e-commerce\vendor\slim\slim\Slim\Slim.php(1210): Slim\Router->dispatch(Object(Slim\Route)) #3 D:\e-commerce\vendor\slim\slim\Slim\Middleware\Flash.php(86): Slim\Slim->call() #4 D:\e-commerce\vendor\slim\slim\Slim\Middleware\MethodOverride.php(94): Slim\Middleware\Flash->call() #5 D:\e-commerce\vendor\slim\slim\Slim\Middleware\PrettyExceptions.php(67): Slim\Middleware\MethodOverride->call() #6 D:\e-commerce\vendor\slim\slim\Slim\Slim.php(1159): Slim\Middleware\PrettyExceptions->call() #7 D:\e-commerce\index.php(18): Slim\Slim->run() #8 {main} thrown in D:\e-commerce\index.php on line 11", isso acontece quando não definimos o Hcode\ no psr-4, já defini e continua assim. ps: Já rodei o comando composer dump-autoload
Olá tudo bem? Esse erro ainda continua? Nós vimos que alterou um pouco seu namespace para Classes
Olá, já resolvi aqui, obrigado.
Eu tou com esse erro...
Fatal error: Uncaught Error: Class 'Hcode\DB\Sql' not found in C:\Users\josemalcher\Documents\01-SERVs\xampp_php7.2.1\htdocs\workspace-Udemy-Curso-Completo-de-php-7\24-Projeto-E-Commerce-Admin\index.php:11 Stack trace: #0 [internal function]: {closure}() #1 C:\Users\josemalcher\Documents\01-SERVs\xampp_php7.2.1\htdocs\workspace-Udemy-Curso-Completo-de-php-7\24-Projeto-E-Commerce-Admin\vendor\slim\slim\Slim\Router.php(200): call_user_func_array(Object(Closure), Array) #2 C:\Users\josemalcher\Documents\01-SERVs\xampp_php7.2.1\htdocs\workspace-Udemy-Curso-Completo-de-php-7\24-Projeto-E-Commerce-Admin\vendor\slim\slim\Slim\Slim.php(1210): Slim\Router->dispatch(Object(Slim\Route)) #3 C:\Users\josemalcher\Documents\01-SERVs\xampp_php7.2.1\htdocs\workspace-Udemy-Curso-Completo-de-php-7\24-Projeto-E-Commerce-Admin\vendor\slim\slim\Slim\Middleware\Flash.php(86): Slim\Slim->call() #4 C:\Users\josemalcher\Documents\01-SERVs\xampp_php7.2.1\htdocs\workspace-Udemy-Curso-Completo-de-php-7\24-Projeto-E-Commerce-Admin\vendor\slim\slim\Sli in C:\Users\josemalcher\Documents\01-SERVs\xampp_php7.2.1\htdocs\workspace-Udemy-Curso-Completo-de-php-7\24-Projeto-E-Commerce-Admin\index.php on line 11
Se alguém consegue ver o problema por ai?
Resolvido... Tem que adicionar no arquivo SQL Hcode\DB
<?php
namespace Hcode\DB;
class Sql {
const HOSTNAME = "localhost";
estou com o mesmo problema
Boa tarde! sou iniciante aqui, estou fazendo o curso da udemy com vocês, e estou precisando de ajuda com erro erro.
Slim Application Error The application could not run because of the following error:
Details Code: 1045 Message: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) File: C:\ecommerce\vendor\hcodebr\php-classes\src\DB\Sql.php Line: 20
Boa noite estou a ter este erro.
Slim Application Error The application could not run because of the following error:
Details Code: 2 Message: Use of undefined constant data - assumed 'data' (this will throw an Error in a future version of PHP) File: C:\xampp\htdocs\ecommerce\index.php Line: 10 Trace
Slim Application Error The application could not run because of the following error:
Details Code: 2 Message: Invalid argument supplied for foreach() File: /home2/megapixx/euqueroqueimarporti.com.br/vendor/hcodebr/php-classes/src/Model.php Line: 33
Ola pessoa!
Estou com esse erro na configuração de alteração de usuario. Ja conferi todo o código e até tentei um código postado pelo professor João, mas o problema continua o mesmo, indicando um possivel erro na classe Page.
Fatal error: Uncaught Error: Call to undefined method Rain\Tpl::assing() in C:\ecommerce\vendor\hcodebr\php-classes\src\Page.php:40 Stack trace: #0 C:\ecommerce\vendor\hcodebr\php-classes\src\Page.php(47): Hcode\Page->setData(Array) #1 C:\ecommerce\index.php(75): Hcode\Page->setTpl('users', Array) #2 [internal function]: {closure}() #3 C:\ecommerce\vendor\slim\slim\Slim\Router.php(200): call_user_func_array(Object(Closure), Array) #4 C:\ecommerce\vendor\slim\slim\Slim\Slim.php(1210): Slim\Router->dispatch(Object(Slim\Route)) #5 C:\ecommerce\vendor\slim\slim\Slim\Middleware\Flash.php(86): Slim\Slim->call() #6 C:\ecommerce\vendor\slim\slim\Slim\Middleware\MethodOverride.php(94): Slim\Middleware\Flash->call() #7 C:\ecommerce\vendor\slim\slim\Slim\Middleware\PrettyExceptions.php(67): Slim\Middleware\MethodOverride->call() #8 C:\ecommerce\vendor\slim\slim\Slim\Slim.php(1159): Slim\Middleware\PrettyExceptions->call() #9 C:\ecommerce\index.php(140): Slim\Slim->run() #10 {main} thrown in C:\ecommerce\vendor\hcodebr\php-classes\src\Page.php on line 40
Segue o código de rota: $app->get("/admin/users", function (){
User::verifylogin();
$users = User::ListAll();
$page = new PageAdmin();
$page->setTpl("users", array(
"users"=>$users
));
});
$app->get("/admin/users", function (){
User::verifylogin();
$page = new PageAdmin();
$page->setTpl("users");
});
$app->get("/admin/users/create", function (){
User::verifylogin();
$page = new PageAdmin();
$page->setTpl("users-create");
});
$app->get("/admin/users/:iduser/delete", function ($iduser){
User::verifylogin();
});
$app->get('/admin/users/:iduser', function($iduser){
User::verifyLogin();
$user = new User();
$user->get((int)$iduser);
$page = new PageAdmin();
$page ->setTpl("users-update", array(
"user"=>$user->getValues()
));
});
$app->post("/admin/users/create", function (){
User::verifylogin();
});
$app->post("/admin/users/:iduser", function ($iduser){
User::verifylogin();
});
$app->run();
?>
Como resolver 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
Tô com um erro parecido. Como resolvê-lo?
Slim Application Error The application could not run because of the following error:
Details Code: 8 Message: Undefined variable: results File: C:\xampp\htdocs\ecommerce\index.php Line: 14 Trace
Olá pessoal, estou com este problema
Slim Application Error The application could not run because of the following error:
Details Code: 2 Message: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number: parameter was not defined File: C:\xampp\htdocs\Bremix_Ecommerce\vendor\Bremix\php-classes\src\DB\Sql.php Line: 61 Trace
Alguém me ajude, por favor!
==>>> https://github.com/ronaldolsilva/ecommerce
Ainda com problema abaixo, nenhuma solução encontrada, preciso de ajuda para continuar o curso. Obrigado.
Fatal error: Uncaught Error: Class 'Hcode\DB\slq' not found in C:\ecommerce\index.php:11 Stack trace: #0 [internal function]: {closure}() #1 C:\ecommerce\vendor\slim\slim\Slim\Router.php(200): call_user_func_array(Object(Closure), Array) #2 C:\ecommerce\vendor\slim\slim\Slim\Slim.php(1210): Slim\Router->dispatch(Object(Slim\Route)) #3 C:\ecommerce\vendor\slim\slim\Slim\Middleware\Flash.php(86): Slim\Slim->call() #4 C:\ecommerce\vendor\slim\slim\Slim\Middleware\MethodOverride.php(94): Slim\Middleware\Flash->call() #5 C:\ecommerce\vendor\slim\slim\Slim\Middleware\PrettyExceptions.php(67): Slim\Middleware\MethodOverride->call() #6 C:\ecommerce\vendor\slim\slim\Slim\Slim.php(1159): Slim\Middleware\PrettyExceptions->call() #7 C:\ecommerce\index.php(18): Slim\Slim->run() #8 {main} thrown in C:\ecommerce\index.php on line 11
Como resolver este problema ?
o meu erro é o seguinte: Slim Application Error The application could not run because of the following error:
DETAILS Code: 8 Message: Undefined index: deszipcode File: C:\ecommerce\views-cache\cart.c5b813be90a10a19f97859c318d75589.rtpl.php Line: 84 TRACE
Olá tudo bem! Estou estudando o curso de vocês na Udemy. Estou com um problema na parte de usuários especificamente na parte do editar o usuário já inserido. Ele me mostra um erro. Peço que por favor olhem. obg!
https://github.com/Srubens/hcode-ecommerce