I know this question has already been asked, but it seems that the startup process has changed a bit with the composer.
I just want to add a class library to my silex project.
So, I made this file: provider \ Lib \ picture.php
<?php namespace MyNamespace; class Picture { function testage() { echo 'hihaaa Γ§a marche'; exit; } }
in vendor / composer / autoload_namespaces.php, I added this line to a large array:
'MyNamespace' => $vendorDir . '/lib/',
And in the main file, I added:
use MyNamespace\Picture as Picture;
and is called like this:
$app->register(new Picture());
which gives me this error:
Fatal error: Class 'MyNamespace\Picture' not found...
I just donβt know how to add a class that I can use from any controller, easily, without the command line (I do not use composer, I loaded silex preconfigured), any idea?
source share