PHP Classes
elePHPant
Icontem

PHP Conditional Event: Call a handler if an event action returns true

Recommend this page to a friend!
  Info   View files Example   View files View files (5)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2017-06-07 (2 years ago) RSS 2.0 feedNot yet rated by the usersTotal: 27 All time: 9,775 This week: 373Up
Version License PHP version Categories
m5 1.0Custom (specified...5PHP 5, Language
Description Author

This class can call a handler if an event action returns true.

It takes a function to be called and evaluate if it returns true.

Another given function will be called in the first returned true.

  Performance   Level  
Name: zinsou A.A.E.Mo´se is available for providing paid consulting. Contact zinsou A.A.E.Mo´se .
Classes: 50 packages by
Country: Benin Benin
Age: 30
All time rank: 8411 in Benin Benin
Week rank: 27 Up1 in Benin Benin Equal
Innovation award
Innovation award
Nominee: 23x

Winner: 2x

 

Details

ConditionalEvent class is a really simple way to make one of your PHP apps users to launch a predefined number of times a predefined action when a predefined condition is respected when they come on your website. For example;imagine that you want to tell the 5 first users who connect to your website and respect the predefined condition that they are women that they, each one,are the happy winner of the gift of day.All you have to do is to add this little script where you want action to be lauched and all is done... The class use a file log to control if action needs to be launched. A suggestion is to replace this part of the script by a database's field control and update. Other major amelioration is to use Ajax , to bring user to launch action...


			public function __construct($condition,$function,$z=0,$x=array())
			$condition must be a string type , it's the name of the first function.This function returned value must be evaluate
			by PHP as true for launching $function which is the name of type string which represent the action which must be launched.
			$z represent the number of times the predefined action must be launched.by default $z equals 0.That means infinite 
			number of times.$x is an array which contains the condition's parameters  in the same order that they have been declared 
			in function's declaration 				
			
			public function eventapply($y=array())
			$y is an array which contains the action to be launched parameters in the same order that they have been declared 
			in function's declaration 				

The script is too short to provide a documentation but you can see a how to use example in the testconditionalEvent.php file.

Bug reporting to leizmo@gmail.com or simply use the dedicated forums to ask your questions...

  Files folder image Files  
File Role Description
Plain text file conditionalEvent.class.php Class conditionalEvent class
Accessible without login Plain text file filelog Data file log
Accessible without login Plain text file license Lic. license
Accessible without login Plain text file readme Doc. readme
Accessible without login Plain text file testconditionalEvent.php Example example script

 Version Control Unique User Downloads Download Rankings  
 0%
Total:27
This week:0
All time:9,775
This week:373Up