![]() |
How to use suggestions and find usage with PHPStorm - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: Best Practices (https://forum.codeigniter.com/forumdisplay.php?fid=12) +--- Thread: How to use suggestions and find usage with PHPStorm (/showthread.php?tid=80441) |
How to use suggestions and find usage with PHPStorm - sprhld - 11-01-2021 Hello! I use PHPStorm and since my code becomes more complex, I miss the suggestions if I want to use a model, I can't see my docs if I use a method and also in the model file all methods are grey, which means, they aren't ins use, witch also means, I can't refactor if necessary. Let me show you what I have at the moment: First of all, I use a BaseModel, where I have some db-request, which I use in several models. The crtSlug() here I can refactor and I find all usage if I search. PHP Code: namespace App\Models; Then, SubjectModel extend BaseModel mostly. Not all, some extends the CI-model like above. crtForm() is grey, I can't find usage. PHP Code: namespace App\Models; What I also do is, to load my models in the BaseController. The very most stuff is need on every page, is it for the navigation or something else. PHP Code: namespace App\Controllers; And this are normal controllers. Here I can auto complete $this->subject but nothing more. I can't see the methods, which are in the subjectModel. Also, you see "timelineModel" above, which only extends Model. This is the basic structure and this one works well weeks ago. But nor yet anymore :/ PHP Code: namespace App\Controllers; So, can anyone help me to write the code better or configure PHPStorm to use the alluded features. Thank you ![]() RE: How to use suggestions and find usage with PHPStorm - kenjis - 11-01-2021 It seems strange. I can auto complete $this->subject-> ![]() RE: How to use suggestions and find usage with PHPStorm - sprhld - 11-01-2021 Hmm... Strange. It work here only on the BaseController. There I have the suggestions and I can find the usage when I search for it. It seems, that any kind of a link between the BaseController and the normal controllers are not working. I cleared any cache in the meantime and run code inspections, but without any effect. RE: How to use suggestions and find usage with PHPStorm - InsiteFX - 11-02-2021 Works here also. RE: How to use suggestions and find usage with PHPStorm - sprhld - 11-13-2021 Okay, it is not because of the structure of CI and it is more my system like the configuration or what so ever :/ If I found a solution, I will post it. Thank you! RE: How to use suggestions and find usage with PHPStorm - sprhld - 01-23-2022 May, It is a CI-problem... because I'm now using more and more the methods of the model directly in my controller, and I found that today: First, I load my model in my BaseController and I have no suggestion in my "subcontroller". This is what I do while investigating an unsuspected result: PHP Code: $this->data['collections'] = $this->collectionSubs->where([ And the result is nothing. I only get the "1" which always comes while doing this print_r(). Suspected was an SELECT to check the problem in my console. Then I added one simple line: PHP Code: $this->collectionSubs = new CollectionSubjectsModell(); And there is the string a want to see. With my first approach, I had no suggestion from PhpStorm, with a "reload" of the model, I had. Without suggestion I had no errors or response, with I had. For the moment, I don't think it's a PhpStorm-thing but a CI-thing and maybe how I use CI :-) Maybe, I will find the problem someday. I keep you informed ![]() PS: If a developer of CI want to see my code, let's try "Code with me" feature. |