Home Tags Traits

Tag: Traits

Writing Reusable Code using Traits in PHP

Traits are way for code reuse which makes it easier to include the same code(trait) in different locations(classes). PHP is a single inheritance language, which means a class could have only one parent class. A trait contains methods and properties like classes, but a...