Open beatelite opened 8 years ago
@beatelite please check your error logs (or turn on error output in your php.ini) and report back. It's difficult to assess the problem without seeing the specific error.
This is the error:
Fatal error: Uncaught exception 'ReflectionException' with message 'Class AR6SAASPlans\Controllers\SignUpCtrl does not exist' in /home/a6/Web/web/app/plugins/ar-saas-plans/vendor/illuminate/container/Container.php:734 Stack trace: #0 /home/atlas6/Web/web/app/plugins/ar-saas-plans/vendor/illuminate/container/Container.php(734): ReflectionClass->__construct('AR6SAASPlans\Co...') #1 /home/a6/Web/web/app/plugins/ar-saas-plans/vendor/illuminate/container/Container.php(629): Illuminate\Container\Container->build('AR6SAASPlans\Co...', Array) #2 /home/a6/Web/web/app/plugins/ar-saas-plans/vendor/getherbert/framework/Herbert/Framework/Application.php(974): Illuminate\Container\Container->make('AR6SAASPlans\Co...', Array) #3 /home/a6/Web/web/app/plugins/ar-saas-plans/vendor/illuminate/container/Container.php(602): Herbert\Framework\Application->make('AR6SAASPlans\Co...') #4 /home/a6/Web/web/app/plugins/ar-saas-plans/vendor/illuminate/container/Container.php(502): Illuminate\Container\Container->callClass('AR6SAAS in /home/a6/Web/web/app/plugins/ar-saas-plans/vendor/illuminate/container/Container.php on line 734
I checked to make sure all my syntax was correct and comparing everything to your docs, it does look like it is.
@beatelite I believe this is a namespace error: you're trying to access the SignUpCtrl class but your autoloader can't find it. Could you try adding use AR6SAASPlans\Controllers\SignUpCtrl;
at the top of your routes.php file (under the namespace declaration)?
Thanks, I placed use AR6SAASPlans\Controllers\SignUpCtrl; in the routes.php and it's still throwing the error.
BTW, this wasn't mentioned in the documentation for the routes.
Tagging @giwrgos88 for some help since it looks like he's using routes effectively.
@beatelite did you tried not to include the twig and just do " dd("testing"); " in your controller?
also trycomposer dump-autoload
@giwrgos88 thanks for chiming in. I did run composer dump-autoload and notta.
I also just tried in my controller:
<?php namespace AR6SAASPlans\Controllers;
class SignUpCtrl {
/**
*
*
public function showSignUp()
{
return dd("testing");
}
}
still getting the error.
My routes.php file:
<?php namespace AR6SAASPlans;
use AR6SAASPlans\Controllers\SignUpCtrl;
/** @var \Herbert\Framework\Router $router */
$router->get([
'as' => 'test',
'uri' => '/test',
'uses' => __NAMESPACE__ . '\Controllers\SignUpCtrl@showSignUp'
]);
@beatelite can you make a zip file of your plugin so i can try it on a test server?
Wow. That would be super helpful.Thank you!!
Here's the link: https://drive.google.com/file/d/0B-r5llGpXi8xQnpGc2ZieXB2VE0/view?usp=sharing
@beatelite on a fresh installation that I did, your routes are working fine. Try to disable all modules and leave only yours enable a try again.
@beatelite For me, it's the same as for @giwrgos88. Working well on a fresh installation.
I also have the same error. Do you fix this error?
Nope. I ditched Herbert since it doesn't really look that active. i love the idea - a lot actually, but was worried about not enough community support.
in my routes.php I have:
In my SignUpCtrl.php in the Controllers folder, I have:
in my signupview.twig file I have
<h1>test</h1>
However, I when I visit mysite.com/test
I get a blank page (console says 500 error. )
If I use a closure like so:
It works for me. What am I missing when I use a controller?