YII php framework support?!

Hello. I’m still young with ur IDE - just trying to switch for it from Eclipse. But right now i have next problem, i’m using yiiframework - php framework (http://yiiframework.com), i added folder with this framework to project, but ide can’t “parse” correct. i.e. it tells me for commong things of this framework - that ‘method undefined’ and as result no code completion and etc.
for example:
Yii::app()->….
Yii::trace(…)
is commong things of that framework. Is there any way to include that framework correctly? maybe i miss something

11 comments
Comment actions Permalink

There's no explicit support for ANY framework yet. Please add your specific requests to out tracker http://www.jetbrains.net/tracker/issues/WI

Regarding Yii & undefined functions - please ensure that you don't have both yiilite.php & uncompressed framework code inside of project (remove yiilite.php)

0
Comment actions Permalink

removing yiilite.php helps, but i had to delete it. Couldn't find any other way to exclude file - only directories.

well, looks like everything is ok now, except the only thing: yii "automagic" substitude getValue/setValue methods as ValueProperty, but ide can't track it.

for example:

function getHelp() {...}
function setHelp() {...}

but in code i can use it as this->help

0
Comment actions Permalink

You should use PHPDOC annotations i.e.

/** 
 * @property $statusOptions string
 * @property $status string
 */ 
class Comment extends CActiveRecord {...
0
Comment actions Permalink

We are still getting the undefined field and method warnings throughout our code, after removing yiilite.php, although a number of warnings were removed by doing that.  We are using a remote sftp connection to our code.  Could it have something to do with the way we set up or directories? We set up our root path to be "/var/www/yii/" and set our deployment path to be "/".  Not sure how this ties in with the remote web server, which points to "/var/www/yii/framework/our_app".

Any suggestions would be appreciated.

0
Comment actions Permalink

This can't be related with deployment plugin (unless it downloaded yiilite back)
Can you please be more specific - which classes and methods/fields are not resolved?

0
Comment actions Permalink

Thank you.  I checked to make sure that yiilite.php was not added back.  It wasn't.  The undefineds are things like $this->render(), $this->redirect(), $model->attributes, etc. in the controllers.  In the models, it doesn't recognize $this-><attribute>, where attribute is the name of the model attribute.  I can see that last one, because the attributes aren't explicitly declared in Yii models.  The first ones should come from parent classes, though.  Thanks for any assistance.

0
Comment actions Permalink

For magic properties you should add PHPDOC @property annotations with appropriate type hints. See http://manual.phpdoc.org/HTMLframesConverter/default/phpDocumentor/tutorial_tags.property.pkg.html for details.

0
Comment actions Permalink

I've tried the @property as recommended, but don't see a difference.  I even tried explicitly declaring the Yii generated variables (var $foo;) inside the class.  They are still not recognized.  Maybe this is because of the Y::import() way of including things?  It also highlights the Yii::import() function itself as unrecognized.

Someone else must have had to deal with this, right?  Our installation is standard, for both PhpStorm and Yii.  Any other suggestions out there?

Thanks in advance.

0
Comment actions Permalink

I repeat, we DO NOT have any framework-specific stuff yet. Please watch http://youtrack.jetbrains.net/issue/WI-322 and linked issues.

0
Comment actions Permalink

There was NO NEED to repeat that.  I was responding to your suggestion that @property would solve the problem.

0
Comment actions Permalink

Other variant to exclude yiilite.php from autocompletion - mark this file as "plain text"

0

Please sign in to leave a comment.