Re: [PHP] Problem using return from a class.

2005-02-09 Thread Jason Wong
On Wednesday 09 February 2005 01:33, Ben Edwards (lists) wrote:

  Maybe you should post a bit of code to illustrate your problem ;)

 I'me just doing:-

   return $radio_html;

 as the last line of the method.

 If I do

   echo $radio_html;

 The condense of the variable gets outputted.

 I could post the method here but its a bit long.

You only need to post concise code that illustrates your problem, a one 
liner to return a value is all the that your method needs.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
New Year Resolution: Ignore top posted posts

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Problem using return from a class.

2005-02-09 Thread Ben Edwards
On Wed, 9 Feb 2005 16:12:58 +0800, Jason Wong [EMAIL PROTECTED] wrote:
 On Wednesday 09 February 2005 01:33, Ben Edwards (lists) wrote:

   Maybe you should post a bit of code to illustrate your problem ;)
 
  I'me just doing:-
 
return $radio_html;
 
  as the last line of the method.
 
  If I do
 
echo $radio_html;
 
  The condense of the variable gets outputted.
 
  I could post the method here but its a bit long.

 You only need to post concise code that illustrates your problem, a one
 liner to return a value is all the that your method needs.

All I woul post them would be 'retrun $radio_htlm'  I will post the
end of the method:

if ( $columns == 0 ) {
  $radio_html .= $this-manditoryStar( $manditory );
} else {
  if ( $manditory ) {
$radio_html .=
trtd colspan=$columnsp class=NormalText
font color=red size=+1 .
*/font You must select at least one option .
/font/p/td/tr;
  }
  $radio_html .= /table;
}

$radio_html .= \n\n!--nend presenter.renderRadioReal--\n\n;

// really nagst hack as rtturn not working
echo $radio_html;
return $radio_html;

++$index;
  }

This works becouse I echo the varable, but not ideal.  The method call
is echo $object-method(...).  If the return was working I would get
the code returned twice, but I only get it returned once.  without the
'nasty hack' I get nothing;(.

Ben

 --
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 --
 Search the list archives before you post
 http://marc.theaimsgroup.com/?l=php-general
 --
 New Year Resolution: Ignore top posted posts

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


 
 --
 Ben Edwards - Bristol, UK, England
 WARNING:This email contained partisan views - dont ever accuse me of
 using the veneer of objectivity
 If you have a problem emailing me use
 http://www.gurtlush.org.uk/profiles.php?uid=4
 (email address this email is sent from may be defunct)


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Problem using return from a class.

2005-02-08 Thread Ben Edwards (lists)
I am having a really odd problem.  I have a class and if I do a return
nothing is returned.  If I do an echo of the variable that is being
returned I can see it so there is something to return.  Is there some
strange bug in PHP?

Ben
-- 
Ben Edwards - Poole, UK, England
If you have a problem sending me email use this link
http://www.gurtlush.org.uk/profiles.php?uid=4
(email address this email is sent from may be defunct)

-- 
Ben Edwards - Poole, UK, England
If you have a problem sending me email use this link
http://www.gurtlush.org.uk/profiles.php?uid=4
(email address this email is sent from may be defunct)



signature.asc
Description: This is a digitally signed message part


RE: [PHP] Problem using return from a class.

2005-02-08 Thread Chris Ramsay
[snip]
I am having a really odd problem.  I have a class and if I do a return
nothing is returned.  If I do an echo of the variable that is being
returned I can see it so there is something to return.  Is there some
strange bug in PHP?
[/snip]
What is it you are doing - are you echoing the call i.e.
echo $myclass-function();
Or something else?

Maybe you should post a bit of code to illustrate your problem ;)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Problem using return from a class.

2005-02-08 Thread Ben Edwards (lists)
On Tue, 2005-02-08 at 16:47 +, Chris Ramsay wrote:
 [snip]
 I am having a really odd problem.  I have a class and if I do a return
 nothing is returned.  If I do an echo of the variable that is being
 returned I can see it so there is something to return.  Is there some
 strange bug in PHP?
 [/snip]
 What is it you are doing - are you echoing the call i.e.
 echo $myclass-function();
 Or something else?
 
 Maybe you should post a bit of code to illustrate your problem ;)

I'me just doing:-

  return $radio_html; 

as the last line of the method.

If I do

  echo $radio_html;

The condense of the variable gets outputted.

I could post the method here but its a bit long.

Ben
-- 
Ben Edwards - Poole, UK, England
If you have a problem sending me email use this link
http://www.gurtlush.org.uk/profiles.php?uid=4
(email address this email is sent from may be defunct)



signature.asc
Description: This is a digitally signed message part