Skip to content

Basic concepts # Namespaces

hertsch edited this page Sep 17, 2013 · 4 revisions

The kitFramework is depending on PHP 5.3 and makes use of namespaces.

Beside the namespaces assigned to the Silex and Symfony components the kitFramework defines two basic namespaces:

  • phpManufaktur - reserved for applications and extensions contributed by the phpManufaktur,
  • thirdParty - reserved for applications and extensions contributed by any third party company or author.

To create an extension MyExtension, first create a directory:

/kit2/extension/thirdparty/thirdParty/MyExtension

create a bootstrap.include.php and a route to your controller class MyController.php and place it at:

/kit2/extension/thirdparty/thirdParty/MyExtension/Control

namespace thirdParty\MyExtension;

use Silex\Application;

class MyController
{
    protected $app = null;

    public function __construct(Application $app)
    {
        $this->app = $app;
    }
}

The kitFramework will take care of autoloading your class.

Namespaces are also used for Templates (see next chapter)!

Clone this wiki locally