TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 06-19-2009, 06:55 AM   #1 (permalink)
The Wanderer
 
Join Date: Dec 2008
Posts: 16
Thanks: 2
ChrisR is on a distinguished road
Default hook sytem

Okay after hours and hours of Google i have had it.

So what i am trying to do is make a hook system but unsure on how to do it.

so i can have a pages with say

Code:
<?php

code here blah blah
$hook->load('me_start');
more code b;lah blah
$hook->load('me_end');
and in the page that gets included some where it has
Code:
<?php
$hook->use('me_start', 'coolfunc');

function coolfunc () {
$wow = 'sup';
echo $sup;
}

?>
so all up it will just put that code whats in that function to were $hook->load is.

something along them lines.
ChrisR is offline  
Reply With Quote
Old 06-19-2009, 03:07 PM   #2 (permalink)
The Contributor
 
ioan1k's Avatar
 
Join Date: Mar 2009
Location: US
Posts: 76
Thanks: 0
ioan1k is on a distinguished road
Default

http://lmgtfy.com/?q=PHP+Observer+Design+Pattern

Read about Observer Design Pattern, and you can accomplish exactly what you are looking to do
__________________
My Portfolio - Work - Need freelance Work?
I've been developing 5 years now, and I learn something new everyday
ioan1k is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Hook System Nor Advanced PHP Programming 6 11-05-2007 06:19 PM


All times are GMT. The time now is 04:07 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design