File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33*/
44component {
55
6- // Index
6+ // Demo page
77 any function index ( event ,rc , prc ){
8- event .setView ( " main/index" );
8+ var uglySQL = " SELECT id,fname,lname FROM users where fullName='Michael Born' and age = 'infinite'" ;
9+ var prettySQL = getInstance ( " Formatter@SQLFormatter" )
10+ .format ( uglySQL );
11+
12+ event .setView (
13+ view = " main/index" ,
14+ args = {
15+ prettySQL : prettySQL ,
16+ uglySQL : uglySQL
17+ }
18+ );
919 }
1020
1121}
Original file line number Diff line number Diff line change @@ -6,4 +6,4 @@ Date : October 15, 2005
66Description :
77 This is only a place holder since everything occurs in application.cfc now.
88----------------------------------------------------------------------->
9- <cfsetting enablecfoutputonly =" no" >
9+ <cfsetting enablecfoutputonly =" no" >
Original file line number Diff line number Diff line change 11<cfoutput >
2- <h1 >Module Tester</h1 >
2+ <h1 >SQLFormatter</h1 >
3+ <p >Prettify your ugly SQL without Hibernate.</p >
34<div >
45 #renderView () #
56</div >
Original file line number Diff line number Diff line change 11<cfoutput >
2- Module Tester
2+ <p >Turn:</p >
3+
4+ <pre ><code class =" language-sql" >#args .uglySQL #</code ></pre >
5+
6+ <p >into:</p >
7+
8+ <pre ><code class =" language-sql" >#args .prettySQL #</code ></pre >
9+
10+ <p >using:</p >
11+
12+ <pre ><code class =" language-js" >getInstance( "Formatter@SQLFormatter" )
13+ .format( "SELECT id,fname,lname FROM users where fullName='Michael Born' and age = 'infinite'" );</code ></pre >
14+
15+ <script src =" https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.1/highlight.min.js" integrity =" sha512-yUUc0qWm2rhM7X0EFe82LNnv2moqArj5nro/w1bi05A09hRVeIZbN6jlMoyu0+4I/Bu4Ck/85JQIU82T82M28w==" crossorigin =" anonymous" referrerpolicy =" no-referrer" ></script >
16+ <script src =" https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.1/languages/javascript.min.js" integrity =" sha512-V3q3W5043LERycIee7tLy1LAfzxblUrmI5J8p3uZF2FQ3QlMp9QddQoy4OgcIzVs4aCMEj9iwGL5UmjqHF/uBA==" crossorigin =" anonymous" referrerpolicy =" no-referrer" ></script >
17+ <script src =" https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.1/languages/sql.min.js" integrity =" sha512-5I+LDIMsGyYrMCqw6hthOUemv4JYGjjVRImZsghX4+SsALaDkU8PFlK1YP7ARi2FX5wwen0dacDLQjVnZsxFyA==" crossorigin =" anonymous" referrerpolicy =" no-referrer" ></script >
18+ <link rel =" stylesheet" href =" https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.1/styles/default.min.css" integrity =" sha512-hasIneQUHlh06VNBe7f6ZcHmeRTLIaQWFd43YriJ0UND19bvYRauxthDg8E4eVNPm9bRUhr5JGeqH7FRFXQu5g==" crossorigin =" anonymous" referrerpolicy =" no-referrer" />
19+ <script >hljs .highlightAll ();</script >
320</cfoutput >
You can’t perform that action at this time.
0 commit comments