Answer the question
In order to leave comments, you need to log in
Yii: autocompletion for model methods not working in PHPStorm?
There is an AjaxController.php controller.
In the init() of the controller, objects are created - instances of classes:
public function init() {<br>
...<br>
// init classes<br>
$this->_oModelSite = new Site;<br>
$this->_oHelperText = new HelperText;<br>
...<br>
}<br>
public function actionAutoBrand() {<br>
...<br>
// getting POST data<br>
$sBrand = $this->_oHelperText->processPostArray($_POST['brand']);<br>
...<br>
}<br>
Answer the question
In order to leave comments, you need to log in
Time to start using PHPDoc
/**
@var Site
*/
protected $_oModelSite;
/**
@var HelperText
*/
protected $_oHelperText;
In this case, most likely, PHPStorm simply does not know that the init function is called somewhere in advance, in which class instances are created. It is possible to try to work around this by directly adding a call to the init function to __construct, or to inherit __construct by instantiating it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question