Yii with PHP Storm Auto Complete and Class Recognition

Asked
Active3 hr before
Viewed126 times

5 Answers

storm
90%

File → Settings → Project settings → PHP → PHP Home → Add.,File → Settings → Project settings → PHP → PHP Home.,Specify path to your PHP. File → Settings → Project settings → PHP → PHP Home. ,I figured it out, pretty easy. All you have to do is go File → Settings → Project settings → PHP → PHP Home → Add. and add the path to your framework folder in yii whereever it is.

Exclude yiilite.php from index:

yiilite.php
load more v
88%

Specify a path to framework directory.,If you are writing unit tests you can include PHPUnit to get code completion:File → Settings → Project settings → PHP → PHP Home → Add. Specify a path to PHPUnit. ,If you are writing unit tests you can include PHPUnit to get code completion: PhpStorm → Preferences → [Project Settings] PHP → Add. Specify a path to PHPUnit. ,Specify a path to PHPUnit.

-`File → Settings → IDE Settings → File Types`. -
`yiilite.php`
to `Ignore files and folders`.
load more v
72%

I’ve created stub generator for components autocomplete, you can find it on packagist bazilio/yii2-stubs-generator (i can’t post links yet). Feel free to leave feedback\feature request on github.,Nope. For custom application components you have to add @property declarations to the class phpdoc. For views see what’s generated by Gii ,Are you sure we can alter the autocomplete recommendations with just Yii.php ? Shouldn’t you do the trick with Application instead?,I also have a question - how do you gracefully trick ide to autocomplete in views?

Not sure how you can do it directly, but this is a possible workaround:

/** @var \app\components\MyComponent $myComponent */

$myComponent = Yii::$app - > myComponent;
load more v
65%

Ctrl - Cmd - G on Mac OS X
75%

With this, we come to an end of this PhpStprm article. I hope you got an idea of the IDE and hope you will start coding ASAP.,PhpStorm has a visual debugger that needs no configuration and provides excellent functionality, this will track what things happening on each step that uses x debug and send to the debugger and we want the unit testing it gives us PHP unit and BDD.,Architecture & Design Patterns,The PhpStorm gives us a very fine way to reflect our code. It also shows us whenever we want to refactor our code, it gives us information about, in which file that code will be reflected or what changes are made.

index.html

<html>

<head>
   <title>Register User</title>
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>

<body>
   <h2>Register User:</h2>
   <!-- we created a form with method post and action is our php file(submit.php) -->
   <form action="submit.php" method="POST">

      <!-- each field we pass the name property because our PHP code grab the filed value with the 'name' of the field -->
      User First name: <input type="text" name="first"> <br>
      User Last name: <input type="text" name="last"> <br>
      Email id: <input type="email" name="email"> <br>
      <input type="submit" name="form_submit" value="Submit">
   </form>
</body>

</html>
load more v

Other "storm-undefined" queries related to "Yii with PHP Storm Auto Complete and Class Recognition"