Menu from MySQL *SOLVED*

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
pfpro
Beginner
Beginner
Posts: 3
Joined: Thu May 10, 2007 3:10 pm

Menu from MySQL *SOLVED*

Post by pfpro »

I try to include the menu (from sql) into my template engine (tbs)

is there any way to store the menu in a string first and display "later", instead of direct echo

like this:

Code: Select all

$mmenu = buildMySQLMenu(1);
echo $mmenu;
thx in advance
phil
Last edited by pfpro on Mon May 14, 2007 2:06 pm, edited 1 time in total.
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

If you want to display the menu later you could try moving the echo $mmenu; command down further in your code.
pfpro
Beginner
Beginner
Posts: 3
Joined: Thu May 10, 2007 3:10 pm

template engine - no echo

Post by pfpro »

come on guys...
that wasn't the type of answer i expected
i'm using a template system...
and want to store the menu output in a string via php
to place this var in my template file

no echo at all
i hate echo!
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

Then the answer is no.

What other way is there for getting output into the browser from PHP?
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Re: template engine - no echo

Post by John »

pfpro wrote:come on guys...
that wasn't the type of answer i expected
i'm using a template system...
and want to store the menu output in a string via php
to place this var in my template file

no echo at all
i hate echo!
1. Then why did you put 'echo' in your example?

2. Suggestion - chill. Folks here are trying to help, and your snap-back answer, quite frankly, isn't appreciated.
John
pfpro
Beginner
Beginner
Posts: 3
Joined: Thu May 10, 2007 3:10 pm

chill, yeah ;)

Post by pfpro »

like i mentioned my template engine echos my output for me

the solution i found is:

Code: Select all

<?
ob_start();

buildMySQLMenu(1);
$mmenu = ob_get_contents();

ob_end_clean();
?>
on template side:

Code: Select all

<div style="height:30">
[var.mmenu]
</div>
i thought the (still) wonderful milonic menu might offer a function for this issue

maybe i didn't describe exactly enough what i was really looking for
keep it poppin'

best regards
phil
Post Reply