I just started development with Aptana Studio 3 and Yiiframework. Since Aptana Studio 3 already supports code completion for PHP and Yiiframework does faciliate correct use of PHPDoc comments and return types, I assumed that calling
$app = Yii::app();
$app->...
should pop up content assist with methods and fields of the CApplication
class. But I only see an empty popup window containing 'No proposal'. The same happens when accessing the application object directly using
Yii::app()-> // empty code assist window
When I declare the type of the $app
variable explicitly, code assist pops up correct:
/**
* @var CApplication
*/
$app = Yii::app();
$app-> // code assist pops up with correct content
I don't have included yiilite.php - this file is stripped from my framework directory. Code assist works, but not as expected.
Is this a bug, or a missing feature? Can anybody else confirm this behaviour of Aptana Studio 3? Is there any workaround?
Thanks, David
Follow the steps given here and the code completion should work properly.
It is also important to explicitly set the 'Project Nature' to (include) PHP. Project->properties->Project Natures
I don't know how exactly I did this, but:
Only with this nature I see all classes, methods etc...
With orginial aptana's "PHP" Nature it was impossible.
"org.eclipse.php.core.PHPNature" is solution for this.
EDIT: PDT might not be required for Aptana since it has PHP support built-in
The other methods mentioned here will not work for YII code assist.
See if this helps:
PHP Include path -> Libraries -> Add External source folder -> Select the 'framework' folder from the YII framework unzipped
Also point #5 from Arek about adding the Eclipse PHP nature helped me too. Thanks
http://firas-vision.com/aptana-yii-2/
please check this solution worked for me , no new plugin , it is just a code fix for com.aptana.editor.php.jar plugin
I pulled a request to change on Aptana git , hope they will include this fix in the next release
http://www.yiiframework.com/forum/index.php/topic/45905-aptana-yii-support-autocomplete/ this seems to have helped with the solution.
Enjoy Yourself