FuelPHP - Why is there a backslash in this code: $email = \Email::forge();

StackOverflow https://stackoverflow.com/questions/19458014

  •  01-07-2022
  •  | 
  •  

Why is there a backslash in this code?

$email = \Email::forge();

I am reading over the Email package documentation on FuelPHPs site. The above code is their example. Why is there a backslash?

有帮助吗?

解决方案

Because the class is declared in global namespace and seems to be used in some other namespace, where it's required.

Here's complete manual about namespaces: http://www.php.net/manual/en/language.namespaces.php

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top