Re: extending a class?

From: Date: Tue, 26 Feb 2002 12:11:02 +0000
Subject: Re: extending a class?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-86230@lists.php.net to get a copy of this message
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 * and then S.Murali Krishna declared.... > > Hi > Instead of extending the class you can create a language object > inside 'form' class and refer it for all your stuffs regardless of > language. > > class form > { > function form($lang) > { > if($lang == "dk") { $this->lang = new dk(); } > else if ($lang == "en") { $this->lang = new en(); } > } > .... > do what ever language stuff with > > $form->lang->somefunc(); > > Is it Ok...? Yes, I think I see what you mean, I'ts similar to the first example of Simons. I think I'll try the 'Pear like' one and hope it doesn't go 'Pear shaped'! Thanks for the help.... - -- - ----------------------------------------------------------- www.explodingnet.com | Projects, Forums and + Articles for website owners - -- Nick Wilson -- | and designers. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8e3tWHpvrrTa6L5oRAqT3AJ9IY9w8Q4nNVcagOx8K5RVNAHH3CwCglx/a /NRExSB2a+/t81N5gbJEme8= =YeLr -----END PGP SIGNATURE-----

« previous php.general (#86230) next »