简体   繁体   English

一个 class 可以从多个类扩展 php

[英]can one class extends from multiple classes php

I have one class that should extend two classes I'm not sure anymore if this is possible and how.我有一个 class 应该扩展两个类我不确定这是否可能以及如何。 would it be possible that for example my shopModell class extends from the logins and safeinput class?例如,我的 shopModell class 是否有可能从登录名和安全输入 class 扩展?

Yes, you can use inheritance with classes.是的,您可以将 inheritance 与类一起使用。 eg class Foo extends Bar { //your code } With two classes you must use dependecies.例如class Foo extends Bar { //your code }对于两个类,您必须使用依赖项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM