Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- interface Links{
- /* return $links as array of links */
- public function getLinks($links= array());
- }
- class RouterManager implements Links{
- public function __construct($hostName){
- $redirectTo = $hostName."Controller";
- return $redirectTo;
- }
- public function getLinks($links= array()){
- //all URI parsing operations to get the host name. Use foreach for the $links and return the host name
- return $links;
- }
- }
- use RouterManager;
- class HostnameFinder{
- protected $toRedirect = null;
- public function __construct (Links $links,$inputLink){ // Dependency Injection
- $toRedirect = $links->getLinks("set of links");
- return new RouterManager( $toRedirect );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement