Php 如何获取调用函数的类/方法名

Php 如何获取调用函数的类/方法名,php,Php,我有一个像这样的“view.php”文件,其中有一个render()方法 class view { public function render(){ require 'views/header.php'; require "views/??/??.php";// ??/?? should be name of class/ method in which render() method is called , is their some propert

我有一个像这样的“view.php”文件,其中有一个
render()
方法

class view {

    public function render(){
        require 'views/header.php';
        require "views/??/??.php";// ??/?? should be name of class/ method in which render() method is called , is their some property for that like get_class or something else. in below 'home.php' ??/?? should be home/index.
        require 'views/footer.php';
    }
}
我有一个像这样的控制器
home.php

<?php
class home{
    public $view;

    function __construct{   
        $this->view = new view;  
    }

    public function index(){              
        $this->view->render();// in this case ??/?? should be home/index
    }
}
?>

我想获取调用
render()
方法的类和方法的名称。例如,我尝试了render()方法
get_class
,但它不起作用,因为它将给出定义函数的类的名称,即在上面的示例中,如果我使用???=
get_class
它将给出类名称
view

是的,我可以在
render()
中使用参数,但在每个控制器中,我都必须定义参数,但它们是否有任何方式,以便我可以不使用参数来执行操作。?提前感谢

可能的副本可能的副本可能的副本可能的副本