| 1 |
lars |
1 |
<com:TContent ID="body" >
|
|
|
2 |
|
|
|
3 |
<h1 id="4601">TTextHighlighter</h1>
|
|
|
4 |
<com:DocLink ClassPath="System.Web.UI.WebControls.TTextHighlighter" />
|
|
|
5 |
|
|
|
6 |
<p id="530316" class="block-content">
|
|
|
7 |
<tt>TTextHighlighter</tt> does syntax highlighting for its body content, including both static text and the rendering results of its child controls. The text being highlighted follows the syntax of the specified <tt>Language</tt>, which can be 'php' (default), 'prado', 'css', 'html', etc. Here, 'prado' stands for the syntax of PRADO control templates.
|
|
|
8 |
</p>
|
|
|
9 |
<p id="530317" class="block-content">
|
|
|
10 |
If line numbers are desired in front of each line, set <tt>ShowLineNumbers</tt> to true.
|
|
|
11 |
</p>
|
|
|
12 |
<p id="530318" class="block-content">
|
|
|
13 |
To use <tt>TTextHighlighter</tt>, simply enclose the contents to be syntax highlighted within the body of a <tt>TTextHighlighter</tt> control. The following example highlights a piece of PHP code,
|
|
|
14 |
</p>
|
|
|
15 |
<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code_530113">
|
|
|
16 |
<com:TTextHighlighter ShowLineNumbers="true">
|
|
|
17 |
<?php
|
|
|
18 |
$str = 'one|two|three|four';
|
|
|
19 |
print_r(explode('|', $str, 2)); // will output an array
|
|
|
20 |
?>
|
|
|
21 |
</com:TTextHighlighter>
|
|
|
22 |
</com:TTextHighlighter>
|
|
|
23 |
|
|
|
24 |
<com:RunBar PagePath="Controls.Samples.TTextHighlighter.Home" />
|
|
|
25 |
|
|
|
26 |
<div class="last-modified">$Id: TextHighlighter.page 1650 2007-01-24 06:55:32Z wei $</div></com:TContent>
|