Improve this Doc

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
namespace myaddon;
class Test extends \View {    // backslash is not typo. It refers to a top-level namespace
    function init(){
        $this->set('Hello from Add-on');

// Using class from add-on

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.

By default Agile Toolkit will also attempt to load your class:


from the file “foo/bar/My/Class.php”, which would be located inside one of the addon locations. PathFinder already defines one location for you, shared/addons but you can add more if you want inside your application class: