Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of jooorooo  >  Object extend  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example
Class: Object extend
Extend objects adding functions dynamically
Author: By
Last change:
Date: 5 months ago
Size: 324 bytes
 

Contents

Class file image Download
<?php

include_once "extend.php";

$t = new ObjectModify();

//add dump method
$t->dump = function($a) {
    
var_dump($a);
};

//set today
$t->dayOfWeek date('l');

//add dump today method
$t->addMethod('today', function () {
    return 
$this->dump($this->dayOfWeek);
});

//dump today method
$t->today();