PHP Classes
elePHPant
Icontem

Dynamic Methods: Add class functions dynamically from script files

Recommend this page to a friend!
  Info   View files View files (5)   DownloadInstall with Composer Download .zip   Reputation   Support forum (3)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2010-12-23 (5 years ago) RSS 2.0 feedStarStarStar 53%Total: 515 All time: 5,419 This week: 1,117Up
Version License PHP version Categories
dynamic-methods 1.0The PHP License5.3PHP 5, Language
Description Author

This class can be used to add class functions dynamically from script files.

It traps calls to inexistent class functions. The class loads script files with the same name as the called function and uses the loaded code to implement the missing functions.

Innovation Award
PHP Programming Innovation award nominee
January 2011
Number 5


Prize: One subscription to the PDF edition of the PHP Architect magazine
One way to extend the functionality of a class is to load external plug-in scripts when certain functions are called.

The inconvenience of this approach is that usually needs to register somehow the functions that are implemented by plug-ins before calling them.

This class implements a more automatic approach that does not require prior plug-in registration.

It implements a default class call function which intercepts calls to missing functions and automatically loads on demand external plug-in scripts with names based on the called function.

Manuel Lemos
Picture of Pashkov Denis Igorevich
  Performance   Level  
Name: Pashkov Denis Igorevich <contact>
Classes: 21 packages by
Country: Ukraine Ukraine
Age: 26
All time rank: 3099 in Ukraine Ukraine
Week rank: 519 Down12 in Ukraine Ukraine Down
Innovation award
Innovation award
Nominee: 10x

Winner: 1x

Details
Please Create folder parts and put file hello_world into it. 
  Files folder image Files  
File Role Description
Plain text file foo Aux. foo
Plain text file hello_world Aux. part hello world
Plain text file main_class.php Class main class
Plain text file readme.txt Doc. readme
Plain text file samples.php Example example

 Version Control Unique User Downloads Download Rankings  
 0%
Total:515
This week:0
All time:5,419
This week:1,117Up
User Ratings User Comments (3)
 All time
Utility:65%StarStarStarStar
Consistency:90%StarStarStarStarStar
Documentation:55%StarStarStar
Examples:60%StarStarStarStar
Tests:-
Videos:-
Overall:53%StarStarStar
Rank:1562