例如,我在文件1中。具有命名空间类的php,如下所示:
<?php
namespace FrameWork\\CPT;
class CPT{
.....
public function register_custom_post_type()
{
$args = array(
\'register_meta_box_cb\' => //PROBLEM: How to reference from a different file
which also contains a namespaced class
register_post_type(\'plugin-cpt\', $args);
}
如何从file2的命名空间类访问公共函数。php?<?php
namespace FrameWork\\Helper;
class Metabox{
.....
public function register_metaboxes()
{
// I want to reference this function
}