I try to replace a variable inside my object method:
$fieldname = "project";
$test = $page->getTemplate()->getProject();
This is my approach:
$test = $page->getTemplate()->'get'.$fieldname();
But I get the error message
syntax error, unexpected ''get'' (T_CONSTANT_ENCAPSED_STRING), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$'