How do I use namespaces to introduce this class file in TP5?

The

directory structure is what it looks like in the picture. Email.php and Index.php are in the same directory and the
namespace is namespace app\ index\ controller ;

IndexEmail
new Indexuse app\index\Controller\Email;


Mar.14,2021

$e = new Email ();


  

there is no need to add use
to the same command space. In addition, please change the class name in your Email file to Mail,TP to specify that the class name and file name must be the same before loading automatically.

Menu