Results 1 to 3 of 3

Thread: Traits in PHP



  1. #1
    Join Date
    May 2016
    Location
    Singapore
    Posts
    2,243

  2. #2

    Default

    A Trait is simply a group of methods that you want include within another class. A Trait, like an abstract class, cannot be instantiated on it’s own.
    example
    trait Sharable
    {
    public function share($item)
    {
    return ‘share this item’;
    }
    }

  3. #3
    Join Date
    May 2016
    Location
    Singapore
    Posts
    2,243


Similar Threads

  1. The requirement of business traits
    By Martinkristen72 in forum Business Forum
    Replies: 11
    Last Post: 05-11-2015, 07:50 AM
  2. The Traits Of A Good SEO Services Firm
    By royal in forum SEO Forum
    Replies: 0
    Last Post: 05-03-2012, 02:32 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
| UKC | VPS Germany | Webmaster Marketplace | Web Hosting Forum | Domain Name Forum | VPS Forum | Webmaster Forum | Website Design Forum | Sites For Sale |