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
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 05-15-2009, 11:16 PM   #1 (permalink)
The Contributor
 
Join Date: Feb 2007
Posts: 64
Thanks: 9
Killswitch is on a distinguished road
Default Using Interfaces

This is something I have yet to touch on, interfaces and abstract classes, and need a bit of help using them. I understand their purpose and logic ( I think ).

I am working on a project that will allow users to buy addons for their website. This website is hosted and maintained by me, but it allows them to manage the data ( they can choose features they want, the template that is installed, etc ).

This is all ran on a component layer so I can easily add these features once they've paid for them ( and there will occasionally be some freebies ).

For the sake of leaving things open for development later ( maybe I will find the need to hire someone to help add new stuff ), I have decided that the component classes should follow a suit. The main admin index checks the required class file, auto instantiates the class ( if defined to do so ), passing important vars to the constructor and calling the performer method. It has a few other required things as well soon that will be sent around to other classes for stats and other things ( again, leaving it open, haven't implemented that yet ).

Basically, what I think I want to use for this is an interface. I have a seperate file for all interfaces ( components, plugins, and a few other things ). I have required the interface class, and in my component, component IMPLEMENTS interface_name.

What I am getting now is an error : interface components not found in file.php. Is there a special way to do this? Does the interface have to exist int he same file, or does it need to be called? I checked the manual, but their examples reside in the same file, which doesn't seem logical in my situation ( because I would have to repeat it over and over ).
Killswitch is offline  
Reply With Quote
 



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
Working with Interfaces Karl Advanced PHP Programming 14 03-20-2013 07:01 AM
Abstract Classes sketchMedia Advanced PHP Programming 18 02-28-2013 05:38 AM
Interfaces Revisited Karl Advanced PHP Programming 5 11-15-2007 02:40 PM


All times are GMT. The time now is 12:02 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