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
请先登录再写评论。
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)
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
You should use PHPDOC annotations i.e.
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.
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?
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.
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.
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.
I repeat, we DO NOT have any framework-specific stuff yet. Please watch http://youtrack.jetbrains.net/issue/WI-322 and linked issues.
There was NO NEED to repeat that. I was responding to your suggestion that @property would solve the problem.
Other variant to exclude yiilite.php from autocompletion - mark this file as "plain text"