-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New class not loaded #189
Comments
Tonic requires that resource classes are already loaded so that it can reflect upon them. You either need to require your class before instantiating Tonic\Application, or get Tonic to require resources for you by using the "load" configuration option. |
I also run this script: require_once '../vendor/peej/tonic/src/Tonic/Autoloader.php'; The script failed at the line: Any idea why the resource cannot be got? |
Having drilled down from Application.php and found the failure occurred at the line 236: |
Hi,
I am using Respond CMS that uses tonic RESTful. I am trying to add a new class in the rest directory. But this class cannot be loaded. I run the following code
require_once '../vendor/peej/tonic/src/Tonic/Autoloader.php';
$app = new Tonic\Application();
$request = new Tonic\Request();
require_once 'myclass.php';
$resource = $app->getResource($request);
$response = $resource->exec();
$response->output();
The class was not loaded, I got error 'Tonic\NotFoundException'. Any help would be appreciated.
Regards
guilan
The text was updated successfully, but these errors were encountered: