mercredi 22 février 2017

Run method from a string value

I have a question about getting value from running a method from a string.

For example

$method1 = "name";
$project->$method1;  // It shows the valid results 

$method2 = "get()->first()->name";
$project->get()->first()-name; // It shows the valid results
$project->$method2; // get a null result

Please help to find a way to make it work.

Thanks,



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2kN2tkG
via IFTTT

Aucun commentaire:

Enregistrer un commentaire