Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Plugin Hooks for a PHP application
blueparukia Offline
Junior Member
**
Posts: 35
Joined: Jan 2008
Post: #7
RE: Plugin Hooks for a PHP application
Easy enough actually. Thanks for your help though, the base of the code:

PHP Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?
class Hook{

    function set_hook($hookname,$function){
        $this->$hookname = $function;
    }
    
    function use_hook($hookname){
       if (function_exists($this->$hookname))
	{
    call_user_func($this->$hookname);
	}
	else
	{
    	
	}
    }

}
?>


Much simple than I would have thought Ouch

(This post was last modified: 02-15-2008 10:13 PM by blueparukia.)
02-15-2008 10:00 PM
Find all posts by this user

« Next Oldest | Next Newest »

Messages In This Thread
RE: Plugin Hooks for a PHP application - blueparukia - 02-15-2008 10:00 PM

 Standard Tools
Forum Jump: