PHPStorm & NetBeans autocomplete problem

  1. PHPStorm 5
  2. NetBeans

The problem: If you type Yii::app()->user<ctrl+space> code completion didn't work. This solve it.

PHPStorm 5

  1. /yii/framework/yii.php right click "Mark as Plain text"
  2. Create new php file in your project /protected directory named yii.php with this content:
<?php

class Yii extends YiiBase
{
	/**
	 * Returns the application singleton or null if the singleton has not been created yet.
	 * @return CWebApplication the application singleton, null if the singleton has not been created yet.
	 */
	public static function app()
	{
		return self::app();
	}
}

That's all. Test it. Yii::app()->user->check<ctrl+space>

NetBeans

  1. Tools->Options->Miscellaneous->Files->Ignored Files Pattern
^(yiilite\.php|CVS|SCCS.....

Create new php file in your project /protected directory named yii.php with this content:

<?php

class Yii extends YiiBase
{
	/**
	 * Returns the application singleton or null if the singleton has not been created yet.
	 * @return CWebApplication the application singleton, null if the singleton has not been created yet.
	 */
	public static function app()
	{
		return self::app();
	}
}

That's all. Test it. Yii::app()->user->check<ctrl+space>

12 0
14 followers
Viewed: 22 323 times
Version: 1.1
Category: Tips
Written by: Stageline
Last updated by: Stageline
Created on: Feb 24, 2013
Last updated: 11 years ago
Update Article

Revisions

View all history

Related Articles