mardi 1 avril 2014

Laravel facade __constructor() usage


Vote count:

0




I have made a class. The class's constructor assigns a value to a class property.


Here is the definition:



class myClass
{
private $_value;

function __construct ($input)
{
$this->_value = $input;
}

function echoThat ()
{
echo $this->_value;
}
}


And the regular usage is:



$x = new myClass("SimpleString");
$x->echoThat();


But I have turned the class into a facade type of class in Laravel so it is used:



myClass::echoThat();


How should I utilize the __construct() method in Laravel Facades like the above example?



asked 1 min ago






Aucun commentaire:

Enregistrer un commentaire