# Using Namespaces in your project¶

Agile Toolkit support namespaces primarily for Add-on management. Here is how you define a class inside a add-on and call it:

// inside shared/addons/myaddon/Test.php
class Test extends \View {    // backslash is not typo. It refers to a top-level namespace
function init(){
parent::init();
$this->set('Hello from Add-on'); } } // Using class from add-on$this->add('myaddon/Test');


Agile Toolkit also supports Composer namespace declarations, so if you would rather use composer.json to define your class locations you can safely do that.

foo\bar\My_Class

\$this->pathfinder->base_location->defineContents(array(