I'm starting to study PHP, I'm trying to make the image path appear, but it returns the following error:
Fatal error: Uncaught Error: Call to undefined method image :: View () in C: \ xampp \ htdocs \ site \ home.php: 20 Stack trace: # 0 C: \ xampp \ htdocs \ app \ Pages.class.php (17): include () # 1 C: \ xampp \ htdocs \ site \ index.php (123): Pages -> construct () # 2 {main} thrown in C: \ xampp \ htdocs \ site \ home.php on line 20
Class routes:
<?php
class Rotas{
static $pastaFotos = 'fotos/';
static $siteUrl = 'http://localhost/site/';
static $index = 'index.php';
static $detalhe = '?pag=detalhe&item';
}
Class image:
<?php
class Imagem {
public static function Exibir($imagem, $w, $h){
$fotos = Rotas::$siteUrl . Rotas::$pastaFotos ;
echo $fotos;
}
public static function Upload() {
}
}
home:
<?php
$portfolio = new Conexao();
$portfolio->ExecSQL("select * from trabalhos");
while($ptf = $portfolio->ListarDados()){
echo $ptf['trabalhos_titulo'] . '<br>';
echo Imagem::Exibir('sss', '34', '34');
}
Thank you in advance!