Re: calling functions to form menus
| From: | Joe Stump | Date: | Mon, 04 Dec 2000 21:26:10 +0000 |
| Subject: | Re: calling functions to form menus | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-28642@lists.php.net to get a copy of this message | ||
Sounds like your functions look like this:
Menu()
{
echo $link1;
echo $link2;
}
when they need to look like this:
Menu()
{
$ret .= $link1;
$ret .= $link2;
return $ret;
}
Basically assign EVERYTHING that is supposed to be "echo"'d and then return that
into your next function.
--Joe
On Mon, Dec 04, 2000 at 02:21:17PM -0700, webmaster@ipo.vpaa.asu.edu wrote:
> Greetings,
>
> Got a tiny problem that I'm unable to figure out. In one file I've
> written two functions, one which forms the table layout for the page,
> and another which forms the links that make up the menu side of the
> table.
>
> In the page that calls the functions I've tried assigning the output of
> the Menu() function to a variable $menu and insert it into the main
> page.
>
> require("FormatPage.php");
>
> $menu = Menu();
> $title ="stuff";
> $header="more stuff";
>
> MainPage($title, $header, $menu);
>
>
> The menu does not get placed inside the table of MainPage, instead it's
> formed above the table. Other than that the functions work fine.
>
> Is there any way to assign the output of a function to a single variable
> and place it inside the table where it's supposed to be?
>
> Thanks.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
-----
Joe Stump, PHP Hacker
joestump98@yahoo.com
http://www.miester.org/
Need a programmer? http://www.google.com/search?q=%22Joe+Stump%22
*****************************************************************
* RENT THIS SPACE - SEEN BY THOUSANDS EACH DAY! *
* Current Sponsor: http://www.smackdown.com
*
*****************************************************************