Error Userscontroller Could Not Be Found
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more cakephp error userscontroller could not be found about Stack Overflow the company Business Learn more about hiring developers or posting ads cakephp auth userscontroller with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow
The Action 'index' Could Not Be Found For Userscontroller
is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up UsersController could not be found up vote 1 down vote favorite I'm
The Action 'show' Could Not Be Found For Userscontroller
new in cakePhp, I've been following a tutorial and (in the tutorial) I created an user table called users, in my database(follow the naming conventions) and everything worked well, but in my project I created a table with a different name called usuarios then, I created the model, view and controller files, I created a file called "login.ctp" with the respective form,and in AppController.php I put this code : the action 'create' could not be found for userscontroller class AppController extends Controller { public $helpers = array('Html','Form','Session'); public $components = array('Session','Auth'=>array( 'controller'=>'usuarios', 'action'=>'login' ) ); public function beforeFilter(){ $this->Auth->Allow('index'); } } And inside the usuariosController.php I added this code: public function logout(){ $this->Auth->logout(); $this->redirect('Pensums/index'); } public function login(){ if($this->request->is('post')){ if($this->Auth->login()){ return $this->redirect($this->Auth->redirecturl()); } $this->Session->setFlash(_('Invalid username or password, please try again')); } } but I receive this error from server: Missing Controller Error: UsersController could not be found. Error: Create the class UsersController below in file: app\Controller\UsersController.php is something missing? please help. php cakephp share|improve this question asked Jan 19 '14 at 5:43 ElijahCarrillo 355 add a comment| 1 Answer 1 active oldest votes up vote 3 down vote UsersController is the default controller than handles the login. This is where it tries to go when you are not logged in. Based on the pasted code, you seem to want to change that to UsuariosController If UsuariosController is properly created and it has the login method, try to change the $components property from AppController to: public $components = array( 'Session', 'Auth' => array( 'loginAction' => array( 'controller' => 'usuarios', 'action' => 'login' ) ) ); When not logged in, it will redirect you to /usuarios/login share|improve this answer answered Jan 19 '14 at 6:53 cor
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the
Controller Could Not Be Found Cakephp
workings and policies of this site About Us Learn more about missing controller in cakephp Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions controller class controller could not be found Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. http://stackoverflow.com/questions/21213629/userscontroller-could-not-be-found Join them; it only takes a minute: Sign up Auth component in cakephp supports only UsersController? up vote 1 down vote favorite I might hav askd question related to this earlier but not satisfied by answers and no answer is working.....My doubt is little different , i have two controllers 1.UsersController. 2.MembersController. My doubt is the Auth component is http://stackoverflow.com/questions/14518791/auth-component-in-cakephp-supports-only-userscontroller working wonders for UsersControllers, but the Auth is not working for MembersController. In simple terms whenever i try to use Auth component for my MembersController, instead of redirecting to Members view. It is displaying UsersController pages....And when i delete the UsersController i get below error... Error: UsersController could not be found. Is there any connection between Auth and Users. How to set Auth component for my MembersController...... This is how i am using it.... public $components = array( 'Session', 'Auth' => array( 'loginRedirect' => array('controller' => 'members', 'action' => 'home'), 'logoutRedirect' => array('controller' => 'members', 'action' => 'index') ) ); public function beforeFilter() { $this->Auth->allow('index', 'view'); } php mysql cakephp share|improve this question asked Jan 25 '13 at 9:23 Php Geek 7231831 why both UsersController and MembersController? arent they one and the same? Or are you trying to only use MembersController? Why did you not specify the cakephp version? that is crucial information for a question like that. –mark Jan 25 '13 at 9:25 I am only trying to use MembersController..
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and http://stackoverflow.com/questions/29233072/cakephp-3-plugin-development-controller-could-not-be-found-error policies of this site About Us Learn more about Stack Overflow the https://github.com/cakephp/cakephp/issues/3930 company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only could not takes a minute: Sign up CakePHP 3 Plugin development controller could not be found error up vote 0 down vote favorite 2 I am trying to create an admin plugin for my website. I baked plugin then user model and controller but when I visit /admin/users/ or /admin/users/index it always gives an error as below: Error: Admin.UsersController could not be found. could not be Error: Create the class UsersController below in file: C:\xampp\htdocs\cake3\plugins\Admin\src\Controller\UsersController.php But of course I have the files in correct locations. Any ideas what causes this problem? Thanks a lot for helps or even efforts. Please ask any further info cakephp cakephp-3.0 share|improve this question edited Mar 24 '15 at 12:54 user4704831 asked Mar 24 '15 at 12:48 İsmail Atkurt 417 did you create your plugin using bake? –José Lorenzo Mar 24 '15 at 13:38 yes Josê i created by shel using cake bake plugin Admin –İsmail Atkurt Mar 24 '15 at 14:28 Show the code for your plugin controller and your composer.json file in your app. Use gist.github.com –José Lorenzo Mar 24 '15 at 14:31 add a comment| 2 Answers 2 active oldest votes up vote 8 down vote Add this line in config/bootstrap.php Plugin::load('Admin', ['routes' => true, 'autoload' => true]); share|improve this answer answered May 21 '15 at 10:23 Tirthraj Singh Bartwal 1314 4 Cakephp3 official documentation book.cakephp.org/3.0/en/plugins.html says Plugin::load('Admin', ['routes' => true]); is enough. Wasted my 3 hours in checking error. adding 'auto
Sign in Pricing Blog Support Search GitHub This repository Watch 656 Star 6,746 Fork 3,050 cakephp/cakephp Code Issues 151 Pull requests 23 Projects 0 Wiki Pulse Graphs New issue 3.0: Setting Default /admin Router Not Working correcting #3930 Closed ghost opened this Issue Jul 10, 2014 · 6 comments Projects None yet Labels routing Milestone 3.0.0 Assignees markstory 3 participants ghost commented Jul 10, 2014 In my routes file I am setting the default /admin action: Router::connect('/admin', ['prefix' => 'admin', 'controller' => 'Users', 'action' => 'home']); When going to /admin, I get an error: Error: UsersController could not be found. Error: Create the class UsersController below in file: src/Controller/Admin/UsersController.php This controller does exist however, and if I browse to: /admin/users/home It works correctly. There seems to be an issue setting the route in this case. If I exclude the 'prefix' => 'admin', then it works correctly. dereuromark added this to the 3.0.0 milestone Jul 10, 2014 CakePHP member markstory commented Jul 10, 2014 Have you tried: Router::prefix('admin', function($routes) { $routes->connect('/', ['controller' => 'Users', 'action' => 'home']); }); Also the path is different for prefix controllers now. Does src/Controller/Admin/UsersController.php exist? markstory added On hold routing labels Jul 10, 2014 ghost commented Jul 10, 2014 Hey @markstory - yep, src/Controller/Admin/UsersController.php exists :) I assume you mean run: Router::prefix('admin', function($routes) { $routes->connect('/', ['controller' => 'Users', 'action' => 'home']); }); From the routes file. I have done this, but it throws an error: Error: Call to undefined method Cake\Routing\Router::prefix() File /home/michael/public_html/bettornet/src/Config/routes.php Line: 56 CakePHP member markstory commented Jul 10, 2014 Sounds like you have an out of date Cake3 copy, as Router::prefix() exists in HEAD. ghost commented Jul 11, 2014 Hey @markstory - I