My PHP codes :
class FrontEndController extends BaseController {
public function Welcome()
{
return View::make('frontend.index');
}
public function Modules($param="")
{
/* convert parameter "$param" be a function */
$prefix = "Mod_"; // func prefix's
if (function_exists($this->$prefix.$param)) {
return $this->$prefix.$param();
}else
{
return $param;
}
}
protected function Mod_product(){
return "You are called CATEGORY";
}
protected function Mod_promo(){
return "You are called PROMO";
}
}
When i use FrontEndController->Modules('product'); i want it return value from Mod_product(), so also when I use FrontEndController->Modules('promo'); it will return value from Mod_promo(). How to do this?