0
I’m trying to make an api and wanted to call different functions of the same php file. The way I managed to do, it works like this:
<?php
include("ClassVeiculos.php");
$Veiculos = new ClassVeiculos();
$Veiculos->getAll();
And the call is: 'localhost/api'
But so he calls just what’s at the root of that file, I wish I could create functions in it, something like:
include("ClassVeiculos.php");
class DAO {
public function getAll(){
$Veiculos = new ClassVeiculos();
$Veiculos->getAll();
}
}
And call as: 'localhost/api/getAll'
But I can’t do it, if someone can help me I’ll be very grateful.