In front of the structure below:
- class View
- class Controller
- new View ()
- class controllerUser extends Controller
- public $ user;
as $usuario
access from View?
In front of the structure below:
as $usuario
access from View?
You can use namespace
to use classes in other files.
use RaizDaPasta\pastaDaClasse\Classe;
Within your file where you make use
instantiate a new object and use the function you want
I do not really understand what you want to do, but I think it should look something like this:
<?php
class Apresentar
{
public function __construct(ControllerUsuario $usuario)
{
echo $usuario->getUsuario();
}
}
class ControllerUsuario
{
private $usuario = 'Fábio';
public function getUsuario()
{
return $this->usuario;
}
}
new Apresentar(new ControllerUsuario);