Notes: This fork works for the current PHPStorm Version, although some Features are not working.
Fork of https://github.com/nvlad/yii2support
- View template names and parameters completion
- Add view parameters after completion
- Inspection for missing view templates
- QuickFix for missing view templates
- Jump to View file (go to declaration)
- Inspection for required and unused template parameters
- QuickFix for required and unused template parameters
- Updates path to view template when file is moved
- Code completion
- Generate params array
Code completion for Yii configuration arrays. Works both in configuration files and on object instantiation. Following cases are supported:
- Array in
$config
parameter inyii\base\Object
or its descendants constructor - Array has a
class
key with valid class representation: fully qualified name as string,ClassName::class
orClass::className()
- Array is a value of a key that corresponds to standard Yii classes (like
db
,request
,mailer
, and so on), and a file with this array is located withinconfig
directory WidgetClass::widget()
andWidgetClass::begin
calls in caseWidgetClass
is a descendant ofyii\base\Widget
$field->widget()
method call onyii\widgets\ActiveField
and its descendants- Inside array in
GridView
,columns
key Yii::createObject
method
Go To Declaration, Rename, Find usages and Help popups work whenever code completion works.
Database connection is required
Use plugin settings window to set up table prefix
- Code completion for
ActiveQuery
(ActiveRecord::find()->where
for example) - Code completion inside
ActiveQuery
linked to ActiveRecord - Inspection in case if
ActiveQuery
not linked toActiveRecord
- Code completion for
ActiveRecord
findAll()
,findOne()
and so on methods - Undetectable
ActiveRecord
table inspection - Code completion in relations methods
- Code completion for migrations
- Condition parameters code completion
- Condition parameters inspection
- Synchronize properties with database
- Unused properties inspection
- Complete model attribute for
$form->field($model, ...)
&Html::active*($model, ...)
methods
- Autocomplete for arrays in model's rules() method
- Yii::createMethod()
- one() and all() methods of ActiveQuery
- Migrations UI Navigator
- Apply/Undo/Redo migrations from UI
- Support Remote CLI for Docker, Vagrant, VM, Remote servers
- Sync IDE DataBase schema after Apply/Undo/Redo migration(s)
- View command execution output
Inspections can be disabled inline /** @noinspection MissedViewInspection */
.
MissedViewInspection
Reports missing view templatesRequireParameterInspection
Analyzes SQL condition and checks if all declared parameters are setUnusedParameterInspection
Detecting unused View parametersViewMissedPhpDocInspection
Inspect PhpDoc for incoming parameters
ObjectFactoryMissedFieldInspection
Reports missing object properties
MissedParamInspection
Analyzes SQL condition and checks if all declared parameters are setPropertiesInspection
Detects properties do not correspond to class fields or table columns in case of ActiveRecordUndetectableTableInspection
Finds ActiveRecord table and check if it exists in database connectionsMissingActiveRecordInActiveQueryInspection
Check if ActiveQuery correctly linked to ActiveRecord
- Download the .zip from Releases
- In PHPStorm go to Settings -> Plugins
- Click the three Dots next to "Installed" at the top
- Press "Install Plugin from Disk"
- Choose the Downloaded .zip File
- Click Apply
The plugin is Open Source. You may contribute either by testing and or by sending pull requests.
Acknowledging and or citing the plugin is as important as direct contributions.