Having problems with DHTML Menu? There is usually somebody here who knows the answer.
pfpro
Beginner
Posts: 3 Joined: Thu May 10, 2007 3:10 pm
Post
by pfpro » Thu May 10, 2007 3:13 pm
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.
Andy
Milonic
Posts: 3308 Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:
Post
by Andy » Thu May 10, 2007 7:51 pm
If you want to display the menu later you could try moving the echo $mmenu; command down further in your code.
pfpro
Beginner
Posts: 3 Joined: Thu May 10, 2007 3:10 pm
Post
by pfpro » Fri May 11, 2007 9:06 am
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!
Andy
Milonic
Posts: 3308 Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:
Post
by Andy » Fri May 11, 2007 9:46 am
Then the answer is no.
What other way is there for getting output into the browser from PHP?
John
Team
Posts: 5967 Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:
Post
by John » Fri May 11, 2007 3:42 pm
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
Posts: 3 Joined: Thu May 10, 2007 3:10 pm
Post
by pfpro » Mon May 14, 2007 2:02 pm
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