PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, April 22, 2022

[FIXED] How to check which model is using by a controller in cakephp-2.3?

 April 22, 2022     cakephp, cakephp-2.3, php     No comments   

Issue

I am facing a model association problem in cakephp-2.3. Described in Plugin model assiciation is not working in cakephp 2.3 with cake ACL

Now it seems to me that the UsersController in not using User model. I have used

public $uses = array ('Cauth.User'); 

But though it seems to me that it does not using this mode. Has there any way to check which model is using my controller in cakephp-2.3?


Solution

You may try get_class() to find out if it is really using the 'User' model, or a generic 'AppModel' or 'Model';

Inside an action of your controller;

debug(get_class($this->User));

If it is a 'Model' or 'AppModel', CakePHP apparently wasn't able to locate or load your User model from the plugin.

Also check if you actually loaded the plugin in your bootstrap.php.

Read the documentation here: Plugins



Answered By - thaJeztah
Answer Checked By - David Marino (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing