摘要:
append class User extends Model { protected $appends = ['is_adult']; public function getIsAdultAttribute() { return $this->attribute['age'] > 18; } } 阅读全文
posted @ 2020-05-18 21:09
八重樱
阅读(694)
评论(0)
推荐(0)
摘要:
确实,PHP 接口是有它的目的的。 它们是契约,是给其他开发人员的说明手册。然而,还是很难理解接口有什么用。 基础 接口是抽象的类,无法直接实例化,但是可被实现。 这是一个基本的例子 interface MyInterface { public function setName(string $na 阅读全文
posted @ 2020-05-18 19:28
八重樱
阅读(682)
评论(0)
推荐(0)

浙公网安备 33010602011771号