Namespaces "use" php - general Qustion

Permalink
Example: autoNav block ------ controller.php
use core;
use Database;
use Page;
//rest of the code

Why i need for example the "use core;" - inside autoNav controller.php? Someone tell me more about this issue.

siton
 
MrKDilkington replied on at Permalink Reply
MrKDilkington
siton replied on at Permalink Reply
siton
Thanks :)

Question 1:
I dont understand how i know when i need to use "USE" and when not. use its like "import" for SRC functions? Can you tell me in simple words the idea her?

Question 2:
This is OOP idea?...And/Or PHP core feature (I can read about this in PHP docs)

Question 3 - Short VS long url.
Inside pageList controller:
use BlockType; // short
use CollectionAttributeKey; // short
use Concrete\Core\Block\BlockController; // long
use Concrete\Core\Page\Feed; // long
use Database; // short
use Page; // short
use Core; // short
use PageList; // short
use Concrete\Core\Attribute\Key\CollectionKey; // long
use Concrete\Core\Tree\Node\Type\Topic;  // long

One time its look like this (Concret/folder/sub-folder.....full url):
use Concrete\Core\Attribute\Key\CollectionKey;

And one time its only "one word":
use Core;

What the difference?
Gondwana replied on at Permalink Reply
Gondwana
This isn't something specific to concrete5, but is a php feature. Documentation is athttp://php.net/manual/en/language.namespaces.importing.php... .
MrKDilkington replied on at Permalink Reply
MrKDilkington