summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages/Controls/TextHighlighter.page
blob: 40806b0285919fdb4303fd3326290a862b3fe95b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<com:TContent ID="body" >

<h1>TTextHighlighter</h1>
<com:DocLink ClassPath="System.Web.UI.WebControls.TTextHighlighter" />

<p>
<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.
</p>
<p>
If line numbers are desired in front of each line, set <tt>ShowLineNumbers</tt> to true.
</p>
<p>
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,
</p>
<com:TTextHighlighter Language="prado" CssClass="source">
&lt;com:TTextHighlighter ShowLineNumbers="true"&gt;
<?php
$str = 'one|two|three|four';
print_r(explode('|', $str, 2)); // will output an array
?>
&lt;/com:TTextHighlighter&gt;
</com:TTextHighlighter>

<com:RunBar PagePath="Controls.Samples.TTextHighlighter.Home" />

</com:TContent>