| Template code | Chunk output | |
|---|---|---|
{#example_1}
<ul>
<li>{$password}</li>
<li>MD5: {$password|md5}</li>
<li>SHA-1: {$password|sha1}</li>
<li>BASE64: {$password|base64}</li>
</ul>
<a href="http://xkcd.com/936/">XKCD on passwords<br/>
<img src="http://imgs.xkcd.com/comics/password_strength.png" width="400" /></a>
{#}
Theme theme = new Theme("examples");
// Fetch template from this file: themes/examples/hashing.chtml
// Inside that file there is a template "snippet" named #example_1
Chunk html = theme.makeChunk("hashing#example_1");
html.set("password", "xkcdrul3s!!");
html.render( out );
|
|
<ul> <li>xkcdrul3s!!</li> <li>MD5: 610edb4865b9f3b3a6af77e450e579</li> <li>SHA-1: 8ca2c434e41d82394d2f1360cc73b0425b7a6cb3</li> <li>BASE64: eGtjZHJ1bDNzISE=</li> </ul> <a href="http://xkcd.com/936/">XKCD on passwords<br/> <img src="http://imgs.xkcd.com/comics/password_strength.png" width="400" /></a>
|
