Comments (9)
这边没有好的办法
from webman.
未来会优化吗
from webman.
你自定义了哪个文件
from webman.
phpstom我这自定义了本地目录的 support\Request::get方法,代码提示和跳转都是跳转都是正确的。
from webman.
我定义的是Model,用了thinkORM ,但编辑器还是会提示illuminate的方法。编辑器是VScode
from webman.
没必要用 support/Model,建议用 app/Model,support目录里尽量不放代码,所有代码尽量放在app目录下。
from webman.
是因为默认情况下,即使安装了thinkORM ,但代码提示还是提示的 illuminate。所以我才 support/Model 覆盖了一下框架自带的命名空间。但是这样虽然thinkORM 的方法会提示,illuminate的方法也会提示,导致有些情况下代码提示就很乱。
from webman.
我觉得你是弄错了,根据thinkorm手册,thinkorm使用 think\Model;
,不应该使用support\Model
。
如果你要自己定义一个自己的thinkorm model的基类,把基类放到app目录下,比如
namespace app;
class Model extends \think\Model
{
}
和support/Model 一点关系都没有,我觉得vscode不会这么蠢到提示到support/Model上去
from webman.
抱歉,重新看了遍文档,可能我理解错了。我以为在项目目录 support 下面加载了一个文件之后,框架里 support 下面的同名文件就不加载了。但是文档说的只是优先加载项目目录的文件。所以我下面的用法应该是错的。
我需要扩充模型的一些方法。所以我在 support\Model.php 写了如下代码:
<?php
namespace support;
use think\Model as BaseModel;
class Model extends BaseModel
{
}
然后在模型中
<?php
namespace app\model;
use support\Model;
class Test extends Model
{
protected $table = 'test';
}
这样会导致模型同时提示ThinkORM和Eloquent ORM的一些方法。
我把support\Model.php改成support\ThinkORM.php,然后模型继承 ThinkORM 就正常了。
from webman.
Related Issues (20)
- Need Help Getting Browser-Detect or Mobile-Detect to Work with Webman HOT 2
- 多级控制器方法名支持驼峰命名的处理办法,希望下个版本加入 HOT 2
- 变量名称错误导致控制台打印状态报错 HOT 2
- Disable view caching when using blade templates? HOT 1
- 压测在webman中进行 redis get 效果不是很理想, 原因未知.. HOT 4
- 我要集成gRPC服务
- 我发现Request获取get和post的格式不一致 HOT 1
- support\Request不支持依赖注入 HOT 2
- 依赖注入,适配symfony的依赖组入组件吗? HOT 1
- 关于单元测试的功能实现,phpunit HOT 1
- webman 启动时报错:Segmentation fault ,请问除了gdb,还有什么调试方案么?
- webman 使用php8.3.1, workerman v5 bate7 , 安装了swow扩展后读取配置文件一直报错 HOT 2
- 关于 Timer::add 的bug
- MongoDb的驱动能否修改最新的? HOT 2
- [bug] $request->action在控制器中不存在方法时该值始终返回小写 HOT 3
- [question] What do you use to generate these docstrings?
- Difficulty Deploying on Shared Hosting Without SSH or Shell Access
- 如何修改请求参数 HOT 1
- 如何做才可以不提示webman的启动参数 HOT 1
- Redis Prefix caused multiple deletion failed HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webman.