PHP Classes

Thanks for that

Recommend this page to a friend!

      PHP Classes blog  >  Using PHP Object Inte...  >  All threads  >  Thanks for that  >  (Un) Subscribe thread alerts  
Subject:Thanks for that
Summary:interface in OOP
Messages:1
Author:Yoni Lamri
Date:2015-07-22 07:42:39
Update:2015-07-22 16:14:59
 

  1. Thanks for that   Reply   Report abuse  
Picture of Yoni Lamri Yoni Lamri - 2015-07-22 16:14:59
This is a really clear tutorial, thanks for sharing this. I basically use this in my controller classes.
You can also mention that you can check implementation with the instanceof operator. For example:
class BaseController implements Controller {...}
$control = new BaseController();
$control instanceof Controller === true;
This could be usefull
In my case i did both, implement an interface in an abstract class.
This class don't have the interface defined function signatures and children must define them.
A simple exemple: a name function which is specific to each children.