Page 1 of 1

display text at the bottom of page

Posted: Sun May 08, 2011 12:38 am
by stevestark5000
I am trying to put the following code at the bottom of the page but the echo and print commands display the code at the top of the page. how to display it at the bottom?

Code: Select all

echo round((memory_get_usage()/1024)/1024, 2) . 'MB of memory used';

Re: display text at the bottom of page

Posted: Sun May 08, 2011 1:33 am
by Benjamin
Well you would want to put that code in the html, where you want it displayed.

Re: display text at the bottom of page

Posted: Sun May 08, 2011 1:35 am
by stevestark5000
yes but the problem with that, the code will not get parsed

Re: display text at the bottom of page

Posted: Sun May 08, 2011 1:42 am
by Benjamin
Why not?

Re: display text at the bottom of page

Posted: Sun May 08, 2011 2:07 am
by stevestark5000
i am not sure why it will not parse the theme.tpl file. inside that file i have {FOOTER}. outside that file i have the code to call the footer, everything displays correctly but the php code does not get parsed.

outside i have this code

Code: Select all

$THEME["FOOTER"] = "<table border='0'>
 <tr><td><?php echo round((memory_get_usage()/1024)/1024, 2) . 'memory used';?>.</td></tr>
</table>

Re: display text at the bottom of page

Posted: Sun May 08, 2011 2:08 am
by Benjamin
Well if you are using a framework you need to research how to assign variables from the controllers and display them in the views.

Re: display text at the bottom of page

Posted: Sun May 08, 2011 2:23 am
by stevestark5000
could you have another look at my above post. i added to it since you last replyed

Re: display text at the bottom of page

Posted: Sun May 08, 2011 2:31 am
by Benjamin
If you're assigning the entire footer to a variable, it should look something like this:

Code: Select all

$THEME["FOOTER"] = "<table border='0'>
 <tr><td>" .  round((memory_get_usage()/1024)/1024, 2) . 'memory used' . ".</td></tr>
</table>";

Re: display text at the bottom of page

Posted: Sun May 08, 2011 2:47 am
by stevestark5000
thank you Benjamin, it worked

Re: display text at the bottom of page

Posted: Sun May 08, 2011 2:51 am
by Benjamin
:drunk:

Re: display text at the bottom of page

Posted: Sun May 08, 2011 9:49 pm
by stevestark5000
what are those dots called in the above code again?

Re: display text at the bottom of page

Posted: Sun May 08, 2011 11:27 pm
by Benjamin