Skip to content

Commit 3780933

Browse files
committed
Documented Stopwatch Helper
1 parent f1ab2ad commit 3780933

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

cookbook/templating/PHP.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,21 @@ portable. Thanks to this helper, you can move the application root directory
310310
anywhere under your web root directory without changing anything in your
311311
template's code.
312312

313+
Profiling Templates
314+
~~~~~~~~~~~~~~~~~~~
315+
316+
Using the ``stopwatch`` helper, you are able to time parts of your template
317+
and display it on the timeline of the WebProfilerBundle::
318+
319+
<?php $view['stopwatch']->start('foo') ?>
320+
... things that gets timed
321+
<?php $view['stopwatch']->stop('foo') ?>
322+
323+
.. tip::
324+
325+
If you use the same name more than once in your template, the times are
326+
grouped on the same line in the timeline.
327+
313328
Output Escaping
314329
---------------
315330

0 commit comments

Comments
 (0)