How to use traits with namespaces?

There are, for example, the trait:
<?php
namespace Traits;

trait MyTrate
{
 public function myTraitFunction()
 { 
 // code
}
}

If you use it in class:
<?php
namespace My\Name\Space;

class MyClass
{
 use Traits\MyTrate;
}

the operator "use" uses namespace My\Name\Space\Traits\MyTrait. That is not going to go from the root, as it is used in the classroom. How, then, to use the traits defined in other namespaces?
Documentation php.net in one of the reviews written about it too, but was not told how to be.
April 3rd 20 at 18:27
2 answers
April 3rd 20 at 18:29
Solution
class MyClass
{
 use \Traits\MyTrate;
}
April 3rd 20 at 18:31
Solution
We still use to declare the namespace after
https://github.com/jayce32/SQLQueryBuilder/blob...
That is, you essentially give the autoloader know that shipping and can make allies
Another option is to write the name of the class along with namespaces from the root
https://github.com/jayce32/SQLQueryBuilder/blob...

Find more questions by tags PHP