Re: object access

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Class constructors can not return anything, you use constructors to 
setup your object, ect... What you want is the following:

> class iTextbox {
>      function iTextbox() {
>          // my constructor
>      }
	function toString() // function name can be anything you like
	{	return 'Textbox Code';
	}
> }

You can access this via a static method
(ex)

echo iTextbox::toString();

Refer to: http://pl2.php.net/manual/en/keyword.paamayim-nekudotayim.php
that should give you an excellent explanation.


On Dec 30, 2003, at 9:32 AM, Gokcen Ogutcu wrote:

> hello all,
> how can i get this code working, without instanciating the iTextbox to 
> an
> variable
>
> thanks to all and happy new year,
> gokcen
>
> ----------------------------------------------
> class iTextbox {
>      function iTextbox() {
>           return "textbox code";
>      }
> }
> echo new iTextBox();
> ----------------------------------------------
>
>
>
> Look here for Free PHP Classes of objects:
> http://phpclasses.UpperDesign.com/
> To unsubscribe from this group, send an email to:
> php-objects-unsubscribe@egroups.com
>
>
>
> Yahoo! Groups Links
>
> To visit your group on the web, go to:
>  http://groups.yahoo.com/group/php-objects/
>
> To unsubscribe from this group, send an email to:
>  php-objects-unsubscribe@yahoogroups.com
>
> Your use of Yahoo! Groups is subject to:
>  http://docs.yahoo.com/info/terms/
>
>
>
>


Look here for Free PHP Classes of objects:
http://phpclasses.UpperDesign.com/
To unsubscribe from this group, send an email to:
php-objects-unsubscribe@egroups.com

 

Yahoo! Groups Links

To visit your group on the web, go to:
 http://groups.yahoo.com/group/php-objects/

To unsubscribe from this group, send an email to:
 php-objects-unsubscribe@yahoogroups.com

Your use of Yahoo! Groups is subject to:
 http://docs.yahoo.com/info/terms/ 



[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux