手机浏览 RSS 2.0 订阅 膘叔的简单人生 , 腾讯云RDS购买 | 超便宜的Vultr , 注册 | 登陆

官方wiki:Configuring PhpStorm IDE for Yii

首页 > Software >

如果到facebook上关注一下yii framework的群组,会发现有人在介绍yiicookbook.org,里面是一本关于1.1的书。
然后去yii framework官方上搜索一下phpstorm,会发现同一个人在说自己用phpstorm,问phpstorm有没有什么支持。结果官网说暂时好象不支持。。。
然后再搜索了一下,发现在yii的官网有一个简单的例子在说如何让项目支持yii framework。看了一下,发现,大多数都用过,只有第一点,说是把yiilite.php过滤掉。这个其实很重要了,否则有些变量就会出现提示两次。
OK,来看官网的wiki吧:http://www.yiiframework.com/wiki/92/configuring-phpstorm-ide-for-yii

Code completion

  1. Exclude yiilite.php from index:
    • File → Settings → IDE Settings → File Types.
    • yiilite.php to Ignore files and folders.
  2. Exclude not used directories, specify resources.
    • File → Settings → Project settings → Directories.
    • Mark framework/cli/views, protected/runtime and assets as excluded.
    • Mark website root as resource root.
  3. Specify path to your PHP.
    • File → Settings → Project settings → PHP → PHP Home.
  4. If your project uses common Yii framework folder you need to include it.
    • File → Settings → Project settings → PHP → PHP Home → Add.
    • Specify a path to framework directory.
  5. If you are writing unit tests you can include PHPUnit to get code completion:
    • File → Settings → Project settings → PHP → PHP Home → Add.
    • Specify a path to PHPUnit.
  • Complete code: Ctrl+Space.
  • Show method arguments: Ctrl+Q.

Testing

You should install PHPUnit to run unit tests.

  1. PHPUnit.
    • Follow official PHPUnit installation guide.
    • In your IDE: Run → Edit configurations.
    • Press "+".
    • Name: anything.
    • Test: depending on what do you want to test select an appropriate option. Specify path.
    • Use XML configuration file: specifying path to phpunit.xml. Often it's path_to_your_webroot/protected/tests/phpunit.xml.
  • To run tests use SHIFT+F10.
OK,现在这样就可以简单的支持yii framework了。只是phpstorm还是有点小问题,因为提示的时候不会显示phpdoc的信息。纠结,啥时候会有doc的提示呢?



本站采用创作共享版权协议, 要求署名、非商业和保持一致. 本站欢迎任何非商业应用的转载, 但须注明出自"易栈网-膘叔", 保留原始链接, 此外还必须标注原文标题和链接.

Tags: phpstorm, yii, facebook

« 上一篇 | 下一篇 »

只显示10条记录相关文章

php pack()函数详解与示例 (浏览: 63220, 评论: 6)
巧用VMware虚拟机NAT端口映射使外网访问虚拟机 (浏览: 49654, 评论: 0)
mongodb删除索引 (浏览: 39954, 评论: 0)
linux 查找目录或文件 (浏览: 36704, 评论: 1)
golang将时间戳转为字符串 (浏览: 35948, 评论: 0)
RabbitVCS 用后感 (浏览: 31636, 评论: 0)
Yiiframework(Yii框架)开发笔记:续四 (浏览: 28191, 评论: 3)
看上去不错:Chrome 扩展 Monster (浏览: 25371, 评论: 2)
redis:Error: read error on connection (浏览: 23993, 评论: 0)
yhustc:Twisted+AC自动机构建高效的过滤服务器 (浏览: 23969, 评论: 2)

发表评论

评论内容 (必填):