BVB Source Codes

DolpinPHP v1.0.0 rapid development framework Show index.html Source code

Return Download DolpinPHP v1.0.0 rapid development framework: download index.html Source code - Download DolpinPHP v1.0.0 rapid development framework Source code - Type:.html
  1. <!doctype html>
  2.  
  3. <title>CodeMirror: Smarty mode</title>
  4. <meta charset="utf-8"/>
  5. <link rel=stylesheet href="../../doc/docs.css">
  6.  
  7. <link rel="stylesheet" href="../../lib/codemirror.css">
  8. <script src="../../lib/codemirror.js"></script>
  9. <script src="smarty.js"></script>
  10. <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
  11. <div id=nav>
  12.   <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
  13.  
  14.   <ul>
  15.     <li><a href="../../index.html">Home</a>
  16.     <li><a href="../../doc/manual.html">Manual</a>
  17.     <li><a href="https://github.com/codemirror/codemirror">Code</a>
  18.   </ul>
  19.   <ul>
  20.     <li><a href="../index.html">Language modes</a>
  21.     <li><a class=active href="#">Smarty</a>
  22.   </ul>
  23. </div>
  24.  
  25. <article>
  26. <h2>Smarty mode</h2>
  27. <form><textarea id="code" name="code">
  28. {extends file="parent.tpl"}
  29. {include file="template.tpl"}
  30.  
  31. {* some example Smarty content *}
  32. {if isset($name) && $name == 'Blog'}
  33.  This is a {$var}.
  34.  {$integer = 451}, {$array[] = "a"}, {$stringvar = "string"}
  35.  {assign var='bob' value=$var.prop}
  36. {elseif $name == $foo}
  37.  {function name=menu level=0}
  38.    {foreach $data as $entry}
  39.      {if is_array($entry)}
  40.        - {$entry@key}
  41.        {menu data=$entry level=$level+1}
  42.      {else}
  43.        {$entry}
  44.      {/if}
  45.    {/foreach}
  46.  {/function}
  47. {/if}</textarea></form>
  48.  
  49.    <script>
  50.      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
  51.        lineNumbers: true,
  52.        mode: "smarty"
  53.      });
  54.     </script>
  55.  
  56.     <br />
  57.  
  58.         <h3>Smarty 2, custom delimiters</h3>
  59.     <form><textarea id="code2" name="code2">
  60. {--extends file="parent.tpl"--}
  61. {--include file="template.tpl"--}
  62.  
  63. {--* some example Smarty content *--}
  64. {--if isset($name) && $name == 'Blog'--}
  65.  This is a {--$var--}.
  66.  {--$integer = 451--}, {--$array[] = "a"--}, {--$stringvar = "string"--}
  67.  {--assign var='bob' value=$var.prop--}
  68. {--elseif $name == $foo--}
  69.  {--function name=menu level=0--}
  70.    {--foreach $data as $entry--}
  71.      {--if is_array($entry)--}
  72.        - {--$entry@key--}
  73.        {--menu data=$entry level=$level+1--}
  74.      {--else--}
  75.        {--$entry--}
  76.      {--/if--}
  77.    {--/foreach--}
  78.  {--/function--}
  79. {--/if--}</textarea></form>
  80.  
  81.    <script>
  82.      var editor = CodeMirror.fromTextArea(document.getElementById("code2"), {
  83.        lineNumbers: true,
  84.        mode: {
  85.          name: "smarty",
  86.          leftDelimiter: "{--",
  87.          rightDelimiter: "--}"
  88.        }
  89.      });
  90.     </script>
  91.  
  92.         <br />
  93.  
  94.         <h3>Smarty 3</h3>
  95.  
  96.         <textarea id="code3" name="code3">
  97. Nested tags {$foo={counter one=1 two={inception}}+3} are now valid in Smarty 3.
  98.  
  99. <script>
  100. function test() {
  101.         console.log("Smarty 3 permits single curly braces followed by whitespace to NOT slip into Smarty mode.");
  102. }
  103. </script>
  104.  
  105. {assign var=foo value=[1,2,3]}
  106. {assign var=foo value=['y'=>'yellow','b'=>'blue']}
  107. {assign var=foo value=[1,[9,8],3]}
  108.  
  109. {$foo=$bar+2} {* a comment *}
  110. {$foo.bar=1}  {* another comment *}
  111. {$foo = myfunct(($x+$y)*3)}
  112. {$foo = strlen($bar)}
  113. {$foo.bar.baz=1}, {$foo[]=1}
  114.  
  115. Smarty "dot" syntax (note: embedded {} are used to address ambiguities):
  116.  
  117. {$foo.a.b.c}      => $foo['a']['b']['c']
  118. {$foo.a.$b.c}     => $foo['a'][$b]['c']
  119. {$foo.a.{$b+4}.c} => $foo['a'][$b+4]['c']
  120. {$foo.a.{$b.c}}   => $foo['a'][$b['c']]
  121.  
  122. {$object->method1($x)->method2($y)}</textarea>
  123.  
  124.         <script>
  125.                 var editor = CodeMirror.fromTextArea(document.getElementById("code3"), {
  126.                         lineNumbers: true,
  127.                         mode: "smarty",
  128.                         smartyVersion: 3
  129.                 });
  130.         </script>
  131.  
  132.  
  133.     <p>A plain text/Smarty version 2 or 3 mode, which allows for custom delimiter tags.</p>
  134.  
  135.     <p><strong>MIME types defined:</strong> <code>text/x-smarty</code></p>
  136.   </article>
  137.  
downloadindex.html Source code - Download DolpinPHP v1.0.0 rapid development framework Source code
Related Source Codes/Software:
HTML 5 responsive weave template v1.0 dream relaxed and blog posts - HTML5 response-refreshing blog dream template is a... 2017-05-06
Responsive precision chemical chemical class dreams to template (adaptive equipment) v1.0 - Response precision chemical chemical dream templat... 2017-05-06
Dream weaving turquoise ankang health information web site template v1.0 - Dream green health health information website full... 2017-05-05
Cisco v1.1 CMS backend content management system - Cisco CMS back-end content management system is a ... 2017-05-05
HTML 5 black reactive booth design dream weaving dedecms site template (adaptive) v1.0 - HTML5 black-response design dream dedecms template... 2017-05-06
WSTShop v1.1.0 B2C revenue system - WSTShop B2C revenue system WSTShop e-commerce syst... 2017-05-06
HTML 5 high-end dedecms decorate construction company enterprise template - Dedecms latest kernel source code, this source cod... 2017-05-06
compromise - Natural language processing in javascript ... 2017-06-05
stack-on-a-budget - A collection of services with great free tiers for... 2017-06-05
packer - Packer is a tool for creating identical machine im... 2017-06-05
pkg - Package your Node.js project into an executable ... 2017-06-05
Dapper - Dapper - a simple object mapper for .Net 2017-06-05
python-fire - Python Fire is a library for automatically generat... 2017-06-04
kaminari - A Scope & Engine based, clean, powerful, custo... 2017-06-04
mongo-express - Web-based MongoDB admin interface, written with No... 2017-05-17
XCL-Charts - Android charting libraries (XCL-Charts is a free c... 2017-05-17
scrollMonitor - A simple and fast API to monitor elements as you s... 2017-05-16

 Back to top