PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of Shibly   Decorator pattern   index.php   Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Decorator pattern
Implements the decorator design pattern
Author: By
Last change: Update of index.php
Date: 9 months ago
Size: 461 bytes
 

Contents

Class file image Download
<?php
spl_autoload_extensions
(".php");
spl_autoload_register();


$books = new Items\books("Jeffry Way", "Learn Jquery in 30 Days", 100);
$books->display();
$borrow = new \Decorator\Borrowable($books);
$borrow->borrowItem("Shibly");
$borrow->borrowItem("Sujon");
$borrow->borrowItem("Raju");
$borrow->borrowItem("Tanmay");
$borrow->borrowItem("Tarin");
$borrow->display();
$books->display();
$borrow->returnItem("Shibly");
$borrow->display();
$books->display();