[prev in list] [next in list] [prev in thread] [next in thread]
List: velocity-dev
Subject: [Velocity Wiki] Update of "VelocityDebuggingTemplate" by TimWhite
From: Apache Wiki <wikidiffs () apache ! org>
Date: 2008-05-20 14:26:32
Message-ID: 20080520142632.5593.20284 () eos ! apache ! org
[Download RAW message or body]
Dear Wiki user,
You have subscribed to a wiki page or wiki category on "Velocity Wiki" for change \
notification.
The following page has been changed by TimWhite:
http://wiki.apache.org/jakarta-velocity/VelocityDebuggingTemplate
------------------------------------------------------------------------------
- I've worked a lot with the PHP templating system, Smarty, and I've adapted it's \
handy debugging console for Velocity. + This console will display a popup window with \
information about all of the variables available in the Velocity Context. It can be \
an invaluable debugging tool.
- Put the code below into a template called "debug.vm", and #parse it at the end of \
the template you want to debug (after the </html> tag). It will pop up a window with \
all of the context variables in it, so you can see what is being passed to your \
template. (Thanks to Dan Chapman for working on this as well). + To use, either add \
this pair of macros to your template, or better yet, to your VM_Global_library.vm \
file. Then from the template you want to debug, you can simply add #showDebugPopup() \
to the bottom of the template you want to debug, and it will pop up a window with \
debugging information. You'll need to remove that invocation before you go to \
production. :)
- Enjoy!
-
- Tim White
Here is the latest version, which uses the ContextTool. You must have access to \
the Context Tool as $context for this to work. There is a version below this that \
does not require that. This newer version also removes any variables that are \
invalid VTL.
-
- To use, either add this pair of macros to your template, or better yet, to your \
VM_Global_Library.vm file. Then from the template you want to debug, you can simply \
add #showDebugPopup() to the bottom of the template you want to debug, and it will \
pop up a window with debugging information. You'll need to remove that invocation \
before you go to production. :)
{{{
##
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic