I want to add my custom class "Authentication.php" to my project but I don't understand how I have to do it ?
I have read many howto about the external libs but nothing work.
ZendFramework/module/Firewall/Module.php
class Module
{
public function onBootstrap(MvcEvent $e)
{
$eventManager = $e->getApplication()->getEventManager();
$moduleRouteListener = new ModuleRouteListener();
$moduleRouteListener->attach($eventManager);
}
public function getConfig()
{
return include __DIR__ . '/config/module.config.php';
}
public function getAutoloaderConfig()
{
return array(
'Zend\Loader\StandardAutoloader' => array(
'namespaces' => array(
__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
'MyNamespace' => __DIR__ . '/../../vendor/MyNamespace/lib/MyNamespace',
),
),
);
}
}
ZendFramework/vendor/MyNamespace/lib/MyNamespace /Authentication.php
<?php
class Authentication {
public function test()
{
die('Work fine');
}
}
?>
How I can call my external lib in my controllers.
Thanks you very much !