snipt

Ctrl+h for KB shortcuts

HTML+PHP

tmdphp tmd_tpl 真正的创新之处:路径的转换。

// 插入图片
<img src="../static/temp/image_test.jpg" alt="" width="220" height="330" />
 
// 引入CSS
<link href="../static/style.css" rel="stylesheet" type="text/css" media="screen" />
 
// 调用JS
<script type="text/javascript" src="../static/test.js"></script>
 
// 包含一个页面
<?php include('inc/footer.tpl.php'); ?>
https://snipt.net/embed/e924332c0b507e96b9eea943c85c9cd6/
/raw/e924332c0b507e96b9eea943c85c9cd6/
e924332c0b507e96b9eea943c85c9cd6
html+php
HTML+PHP
11
2019-08-18T21:39:26
True
False
False
Sep 21, 2012 at 03:17 AM
/api/public/snipt/47435/
tmdphp-tmd_tpl-2
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1"> 1</a> <a href="#L-2"> 2</a> <a href="#L-3"> 3</a> <a href="#L-4"> 4</a> <a href="#L-5"> 5</a> <a href="#L-6"> 6</a> <a href="#L-7"> 7</a> <a href="#L-8"> 8</a> <a href="#L-9"> 9</a> <a href="#L-10">10</a> <a href="#L-11">11</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>// 插入图片 </span><span id="L-2"><a name="L-2"></a><span class="p">&lt;</span><span class="nt">img</span> <span class="na">src</span><span class="o">=</span><span class="s">&quot;../static/temp/image_test.jpg&quot;</span> <span class="na">alt</span><span class="o">=</span><span class="s">&quot;&quot;</span> <span class="na">width</span><span class="o">=</span><span class="s">&quot;220&quot;</span> <span class="na">height</span><span class="o">=</span><span class="s">&quot;330&quot;</span> <span class="p">/&gt;</span> </span><span id="L-3"><a name="L-3"></a> </span><span id="L-4"><a name="L-4"></a>// 引入CSS </span><span id="L-5"><a name="L-5"></a><span class="p">&lt;</span><span class="nt">link</span> <span class="na">href</span><span class="o">=</span><span class="s">&quot;../static/style.css&quot;</span> <span class="na">rel</span><span class="o">=</span><span class="s">&quot;stylesheet&quot;</span> <span class="na">type</span><span class="o">=</span><span class="s">&quot;text/css&quot;</span> <span class="na">media</span><span class="o">=</span><span class="s">&quot;screen&quot;</span> <span class="p">/&gt;</span> </span><span id="L-6"><a name="L-6"></a> </span><span id="L-7"><a name="L-7"></a>// 调用JS </span><span id="L-8"><a name="L-8"></a><span class="p">&lt;</span><span class="nt">script</span> <span class="na">type</span><span class="o">=</span><span class="s">&quot;text/javascript&quot;</span> <span class="na">src</span><span class="o">=</span><span class="s">&quot;../static/test.js&quot;</span><span class="p">&gt;&lt;/</span><span class="nt">script</span><span class="p">&gt;</span> </span><span id="L-9"><a name="L-9"></a> </span><span id="L-10"><a name="L-10"></a>// 包含一个页面 </span><span id="L-11"><a name="L-11"></a><span class="cp">&lt;?php</span> <span class="k">include</span><span class="p">(</span><span class="s1">&#39;inc/footer.tpl.php&#39;</span><span class="p">);</span> <span class="cp">?&gt;</span> </span></pre></div> </td></tr></table>
php, template, tmd_tpl, tmdphp, 创新, 模板引擎, 路径转换