Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Olá boa tarde, estou começando a estudar PHP, estou tentando fazer com que o caminho da imagem apareça, porém retorna o seguinte erro:
Fatal error: Uncaught Error: Call to undefined method imagem::Exibir() in C:\xampp\htdocs\site\home.php:20 Stack trace: #0 C:\xampp\htdocs\app\Paginas.class.php(17): include() #1 C:\xampp\htdocs\site\index.php(123): Paginas->__construct() #2 {main} thrown in C:\xampp\htdocs\site\home.php on line 20
Class rotas:
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
class Rotas{
static $pastaFotos = 'fotos/';
static $siteUrl = 'http://localhost/site/';
static $index = 'index.php';
static $detalhe = '?pag=detalhe&item';
}
**Class imagem:**
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Description of Imagem
*
* @author Janaina
*/
class Imagem {
public static function Exibir($imagem, $w, $h){
$fotos = Rotas::$siteUrl . Rotas::$pastaFotos ;
echo $fotos;
}
public static function Upload() {
}
}
**home:**
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
$portfolio = new Conexao();
$portfolio->ExecSQL("select * from trabalhos");
while($ptf = $portfolio->ListarDados()){
echo $ptf['trabalhos_titulo'] . '<br>';
echo Imagem::Exibir('sss', '34', '34');
}
Obrigada desde já.Carregando comentários...