mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-09 21:04:28 +02:00
- delete obsolete files
This commit is contained in:
@@ -1,22 +0,0 @@
|
|||||||
title = Welcome to Smarty!
|
|
||||||
cutoff_size = 40
|
|
||||||
bold = false
|
|
||||||
pageTitle = "This is mine"
|
|
||||||
bodyBgColor = '#eeeeee'
|
|
||||||
tableBorderSize = 3
|
|
||||||
tableBgColor = "#bbbbbb"
|
|
||||||
rowBgColor = #cccccc
|
|
||||||
|
|
||||||
Intro = """This is a value that spans more
|
|
||||||
than one line. you must enclose
|
|
||||||
it in triple quotes."""
|
|
||||||
|
|
||||||
Quote1 = """'value should contain a
|
|
||||||
sigle quote'"""
|
|
||||||
|
|
||||||
Quote2 = """ "value should contain a " double quote" """
|
|
||||||
|
|
||||||
[setup]
|
|
||||||
bold = true
|
|
||||||
|
|
||||||
[params]
|
|
@@ -1,5 +0,0 @@
|
|||||||
This is the header
|
|
||||||
|
|
||||||
gee is {$gee} foo is {$foo}
|
|
||||||
|
|
||||||
done with header
|
|
@@ -1,3 +0,0 @@
|
|||||||
|
|
||||||
Include file
|
|
||||||
<br>{assign var=inc value='assign include'}{$inc}
|
|
@@ -1,10 +0,0 @@
|
|||||||
This is an example of a compiled template.
|
|
||||||
|
|
||||||
$foo = {$foo}
|
|
||||||
$foo[0] = {$foo[0]}
|
|
||||||
$foo[1] = {$foo[1]}
|
|
||||||
$foo[2] = {$foo[2]}
|
|
||||||
|
|
||||||
function:
|
|
||||||
|
|
||||||
End Test
|
|
@@ -1,2 +0,0 @@
|
|||||||
<br>This is from nocache_inc.tpl
|
|
||||||
<br>cached time is {time()}
|
|
@@ -1,3 +0,0 @@
|
|||||||
|
|
||||||
Test debug
|
|
||||||
{debug}
|
|
@@ -1,5 +0,0 @@
|
|||||||
Test of if tags <br>
|
|
||||||
{foreach item=value from=$values}
|
|
||||||
Value of {$value} is {if $value<10} less then 10 {elseif ($value GT 100) AND ($value <= 500)} something between 100 and 500 {else} somthing else {/if}<br>
|
|
||||||
{/foreach}
|
|
||||||
|
|
@@ -1,25 +0,0 @@
|
|||||||
Test of { include } and local/global variable scope
|
|
||||||
<br>the original value of $foo = {$foo}
|
|
||||||
<br>
|
|
||||||
{assign var=foo2 value='yzx'}
|
|
||||||
<br> foo2 before { include } = {$foo2}
|
|
||||||
{include file='test_inc2.tpl'}
|
|
||||||
<br>
|
|
||||||
<br>Here we are back in test_inc.tpl
|
|
||||||
<br>$foo has its old value = {$foo}
|
|
||||||
<br>this is $foo2 a global variable created in test_inc2.tpl = {$foo2}
|
|
||||||
<br>{if isset($foo3)} $foo3 must be unknow here {/if}
|
|
||||||
<br>
|
|
||||||
<br>Test include with parent scope
|
|
||||||
{include file='test_inc2.tpl' scope='parent'}
|
|
||||||
<br>Here we are back in test_inc.tpl
|
|
||||||
<br>$foo has its new value = {$foo}
|
|
||||||
<br>this is $foo2 a global variable created in test_inc2.tpl = {$foo2}
|
|
||||||
<br>this is $foo3 a normal variable created in test_inc2.tpl = {$foo3}
|
|
||||||
<br>
|
|
||||||
<br>Test include with root scope
|
|
||||||
{include file='test_inc2.tpl' scope='root'}
|
|
||||||
<br>Here we are back in test_inc.tpl
|
|
||||||
<br>$foo has its new value = {$foo}
|
|
||||||
<br>this is $foo2 a global variable created in test_inc2.tpl = {$foo2}
|
|
||||||
<br>this is $foo3 a normal variable created in test_inc2.tpl = {$foo3}
|
|
@@ -1,6 +0,0 @@
|
|||||||
<br>Here starts test_inc2.tpl
|
|
||||||
<br>$foo in test_inc2 before changing = {$foo}
|
|
||||||
{assign var=foo value="bah"}
|
|
||||||
<br>$foo in test_inc2 after changing = {$foo}
|
|
||||||
{assign var=foo2 value="bla" global=true}
|
|
||||||
{assign var=foo3 value="foo3 was set"}
|
|
@@ -1,3 +0,0 @@
|
|||||||
Test of { insert }
|
|
||||||
<br>{insert name='test' foo='bar'}
|
|
||||||
<br>insert with assign {insert name='test' foo='bar' assign=var}{$var}
|
|
@@ -1,11 +0,0 @@
|
|||||||
Test caching and nocache attribute
|
|
||||||
<br>cached time is {time()}
|
|
||||||
<br>nocached time by '{time() nocache=true}' {time() nocache=true}
|
|
||||||
<br>
|
|
||||||
<br>calling '{include file="nocache_inc.tpl" caching_lifetime=25}' {include file="nocache_inc.tpl" caching_lifetime=25}
|
|
||||||
<br>
|
|
||||||
<br>calling '{include file="nocache_inc.tpl" nocache=true}' {include file="nocache_inc.tpl" nocache=true}
|
|
||||||
{nocache}
|
|
||||||
{assign var=a value=1}
|
|
||||||
<br>{if $a < 5}{$a|truncate} lt 5{else}a ge 5{/if}
|
|
||||||
{/nocache}
|
|
@@ -1,9 +0,0 @@
|
|||||||
Test caching and nocache attribute
|
|
||||||
<br>cached time is {$t1}
|
|
||||||
<br>nocached time is {$t2}
|
|
||||||
<br>
|
|
||||||
{$t1+$t1} {$t1+$t2}
|
|
||||||
<br>
|
|
||||||
{nocache}
|
|
||||||
{for $i=0;$i<10;$i++}{$i}{/for}
|
|
||||||
{/nocache}
|
|
@@ -1,6 +0,0 @@
|
|||||||
|
|
||||||
Test methode chaining
|
|
||||||
{assign var=x value=33}
|
|
||||||
<br>{assign var=x2 value=10}{$person->object->setName('peter')->setAge($x+4)->introduce()}
|
|
||||||
<br>{$person->object->setAge($x+$x2)->setName('paul')->introduce()}
|
|
||||||
|
|
@@ -1,5 +0,0 @@
|
|||||||
|
|
||||||
Test registered object
|
|
||||||
<br>{/test->hello}
|
|
||||||
<br>{/test->hello p1=1 p2=2}
|
|
||||||
|
|
@@ -1,7 +0,0 @@
|
|||||||
Input form for parser testing <BR>
|
|
||||||
<form name="Testparser" action="test_parser.php" method="post">
|
|
||||||
<strong>Template input</strong>
|
|
||||||
<textarea name="template" rows="10" cols="60">{$template|escape}</textarea>
|
|
||||||
<input name="Update" type="submit" value="Update">
|
|
||||||
</form >
|
|
||||||
|
|
@@ -1,7 +0,0 @@
|
|||||||
Test of function plugin
|
|
||||||
{nocache}
|
|
||||||
{counter assign=foo start=10 skip=5}
|
|
||||||
<br>{$foo}
|
|
||||||
{counter}
|
|
||||||
<br>{$foo}
|
|
||||||
{/nocache}
|
|
@@ -1,7 +0,0 @@
|
|||||||
Test of function plugin
|
|
||||||
{nocache}
|
|
||||||
{counter assign=foo start=10 skip=5}
|
|
||||||
<br>{$foo}
|
|
||||||
{counter}
|
|
||||||
<br>{$foo}
|
|
||||||
{/nocache}
|
|
@@ -1,159 +0,0 @@
|
|||||||
<pre>SMARTY SMOKE TEST
|
|
||||||
|
|
||||||
VARIABLE TESTS:
|
|
||||||
|
|
||||||
$foo is {$foo}
|
|
||||||
|
|
||||||
$baz[1] is {$baz[1]}
|
|
||||||
|
|
||||||
$blah['b'] is {$blah['b']}
|
|
||||||
|
|
||||||
$blah[$baz[1]] is {$blah[$baz[1]]}
|
|
||||||
|
|
||||||
$foo.$baz[1] is {$foo.$baz[1]}
|
|
||||||
|
|
||||||
$foo.$foo is {$foo.$foo}
|
|
||||||
|
|
||||||
{"foo"}
|
|
||||||
|
|
||||||
OBJECT TESTS:
|
|
||||||
|
|
||||||
$myobj->foo is {$myobj->foo}
|
|
||||||
|
|
||||||
$myobj->test is {$myobj->test}
|
|
||||||
$myobj->test() is {$myobj->test()}
|
|
||||||
$myobj->test(1) is {$myobj->test(1)}
|
|
||||||
$myobj->test(1,'two') is {$myobj->test(1,'two')}
|
|
||||||
$myobj->test(count($baz)) is {$myobj->test(count($baz))}
|
|
||||||
$myobj->test($myobj->test(count($baz))) is {$myobj->test($myobj->test(count($baz)))}
|
|
||||||
$myobj->test($foo|escape) is {$myobj->test($foo|escape)}
|
|
||||||
|
|
||||||
PHP TESTS:
|
|
||||||
|
|
||||||
|
|
||||||
COMMENT TESTS:
|
|
||||||
|
|
||||||
{* this is a comment *}
|
|
||||||
{* another $foo comment *}
|
|
||||||
{* another <?=$foo?> comment *}
|
|
||||||
{* multi line
|
|
||||||
comment *}
|
|
||||||
{* /* foo */ *}
|
|
||||||
A{* comment *}B
|
|
||||||
C
|
|
||||||
D{* comment *}
|
|
||||||
{* comment *}E
|
|
||||||
F
|
|
||||||
G{* multi
|
|
||||||
line *}H
|
|
||||||
I{* multi
|
|
||||||
line *}
|
|
||||||
J
|
|
||||||
|
|
||||||
ASSIGN:
|
|
||||||
|
|
||||||
A
|
|
||||||
{assign var=zoo value="blah"}
|
|
||||||
B
|
|
||||||
C{assign var=zoo value="blah"}D
|
|
||||||
E{assign var=zoo value="blah"}
|
|
||||||
F
|
|
||||||
G
|
|
||||||
{assign var=zoo value="blah"}H
|
|
||||||
{assign var=zoo value="joe{$myobj->test(1)}bar"}
|
|
||||||
|
|
||||||
zoo is {$zoo}
|
|
||||||
|
|
||||||
SPACING TESTS:
|
|
||||||
|
|
||||||
{$foo}
|
|
||||||
|
|
||||||
{$foo}{$foo}
|
|
||||||
|
|
||||||
A{$foo}
|
|
||||||
|
|
||||||
A{$foo}B
|
|
||||||
|
|
||||||
{$foo}B
|
|
||||||
|
|
||||||
IF TESTS:
|
|
||||||
|
|
||||||
{if $foo eq "baz"}
|
|
||||||
IS BAZ
|
|
||||||
{elseif $foo == "lala"}
|
|
||||||
IS LALA
|
|
||||||
{else}
|
|
||||||
IS NONE
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
{if $myint+5 EQ 9}
|
|
||||||
IS NINE
|
|
||||||
{else}
|
|
||||||
IS NOT NINE
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
{if $myint + 5 eq 9}
|
|
||||||
IS NINE
|
|
||||||
{else}
|
|
||||||
IS NOT NINE
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
{if count($baz)-2 eq 1}
|
|
||||||
IS ONE
|
|
||||||
{else}
|
|
||||||
IS NOT ONE
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
{if $foo.$foo2 eq "barbar2"}
|
|
||||||
IS BARBAR2
|
|
||||||
{else}
|
|
||||||
IS NOT BARBAR2
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
{if $not_logged}
|
|
||||||
NOT LOGGED
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
{if "joe{$myobj->test(1)}bar"}
|
|
||||||
FOO
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
TEST INCLUDE:
|
|
||||||
|
|
||||||
{include file="header.tpl" gee="joe"}
|
|
||||||
{include file="header.tpl" gee="joe $foo bar"}
|
|
||||||
{include file="header.tpl" gee="joe{$foo}bar"}
|
|
||||||
{include file="header.tpl" gee="joe{$foo.$foo}bar"}
|
|
||||||
{include file="header.tpl" gee="joe{$myobj->test(1)}bar"}
|
|
||||||
{include file=$includeme}
|
|
||||||
{include file=$includeme gee="joe"}
|
|
||||||
{include file="{$top}.tpl"}
|
|
||||||
|
|
||||||
JAVSCRIPT TEST
|
|
||||||
|
|
||||||
<script language="javascript">
|
|
||||||
function sayhi()
|
|
||||||
{
|
|
||||||
alert('hi there!');
|
|
||||||
}
|
|
||||||
function foobar() { alert('foobar'); }
|
|
||||||
</script>
|
|
||||||
|
|
||||||
MATH TESTS:
|
|
||||||
|
|
||||||
$one+2 is {$one+2}
|
|
||||||
$one + 2 - $one is {$one + 2 - $one}
|
|
||||||
$one*$one is {$one*$one}
|
|
||||||
$one/$one is {$one/$one}
|
|
||||||
abs(-$one) is {abs(-$one)}
|
|
||||||
|
|
||||||
$footest is {$footest}
|
|
||||||
|
|
||||||
FOREACH TESTS:
|
|
||||||
|
|
||||||
{foreach from=$blah key="idx" item="val"}
|
|
||||||
$idx/$val is {$idx}/{$val}
|
|
||||||
{/foreach}
|
|
||||||
|
|
||||||
TEST FINISHED
|
|
||||||
</pre>
|
|
Reference in New Issue
Block a user