-1
I have several classes, not to be setting method by method I created a class with all methods instantiated, so only Set the method, I wanted to know if it works.
Instances.class.php
class Instancias {
public $Header;
public function GetInstancias () {
$this->Header = new Header;
}
}
Header.class.php
class Header {
public function GetHeader () {
echo "Header";
}
}
index php.
require "Instancias.class.php";
require "Header.class.php";
$Instancias = new Instancias;
$Instancias->GetInstancias ();
$this->GetHeader ();
If you don’t want to be instantiative is an indication that you don’t need classes, right?
– Maniero
@Cool and indicated to do this way?
– ProgramadorAprendiz
I don’t think so, but people are doing every crazy thing in PHP that I don’t know anything else, the crazy turned normal :D
– Maniero