I looked into registries (singleton registries), and while I can see the
advantage they provide, most every article I read advised AGAINST using
singleton registries because it creates extra dependencies (ie. a file needs
the database class AND the registry class instead of just the database
class)
Allen,
Before you go with my static-approach, please do consider Shawn's registry
pattern suggestion. That's pretty sweet too ;-).
A little response to your long text, before I help you fix the bug. A static
property is basically the same as a regular property on an object. Only
difference is tha
Sorry, and then I didn't keep it on list :-(
Shawn McKenzie wrote:
> Please reply to the list. Just google for "php registry pattern". Here is a
> very basic example. There are better OOP people here than I.
>
> class Registry {
> protected $_objects = array();
>
> function set($name,
Wouter,
Implementing your static idea was pretty easy, I was already referencing
Notifier with the :: operator in my other methods, however I am running into
trouble assigning new values to the static array.
I am getting a "syntax error, unexpected '[' " on this line of my Notifier
class:
Notifi
teSingle($id, 1); // This completes a function within
> Meetgreet class. That function needs to be able to use the Notifier
> function
> addtoQ(), how would this be accomplished?
>
> ?>
> ...
> ...
>
> printQ() ?>
>
> On Mon, Dec 14, 2009 at 6:07 PM,
Allen McCabe wrote:
> Hey all (and Nirmalya, thanks for the help!),
>
>
> I have a question that I just can't seem to find via Google.
>
> I want to be able to add messages to a qeue whenever my classes complete (or
> fail to complete) specific functions. I think have a call within my html to
>
be accomplished?
?>
...
...
printQ() ?>
On Mon, Dec 14, 2009 at 6:07 PM, Nirmalya Lahiri
wrote:
> --- On Tue, 12/15/09, Allen McCabe wrote:
>
> > From: Allen McCabe
> > Subject: [PHP] Class not functioning
> > To: "phpList"
> > Date: Tuesday, Dec
--- On Tue, 12/15/09, Allen McCabe wrote:
> From: Allen McCabe
> Subject: [PHP] Class not functioning
> To: "phpList"
> Date: Tuesday, December 15, 2009, 6:17 AM
> Hey everyone, I just delved into
> classes recently and have been having
> moderate success so fa
Hey everyone, I just delved into classes recently and have been having
moderate success so far.
I have a puzzler though.
I have the following class decalred and instantiated:
class Notify {
var $q = array();
public function addtoQ($string, $class)
{
$message = ''. $string .'';
$this->q[]
9 matches
Mail list logo