mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 03:14:27 +02:00
update changes
This commit is contained in:
20
QUICKSTART
20
QUICKSTART
@@ -143,10 +143,17 @@ require("Smarty.class.php");
|
|||||||
$smarty = new Smarty;
|
$smarty = new Smarty;
|
||||||
$smarty->assign("Name","Ned");
|
$smarty->assign("Name","Ned");
|
||||||
$smarty->assign(array(
|
$smarty->assign(array(
|
||||||
|
<<<<<<< QUICKSTART
|
||||||
|
"FirstName" => "Fred",
|
||||||
|
"LastName" => "Flanders",
|
||||||
|
"Address" => "Springfield"
|
||||||
|
));
|
||||||
|
=======
|
||||||
"FirstName" => "Ned",
|
"FirstName" => "Ned",
|
||||||
"LastName" => "Flanders",
|
"LastName" => "Flanders",
|
||||||
"Address" => "Springfield"
|
"Address" => "Springfield"
|
||||||
));
|
));
|
||||||
|
>>>>>>> 1.2
|
||||||
$zipcode = "55555";
|
$zipcode = "55555";
|
||||||
$smarty->assign("Zipcode",$zipcode);
|
$smarty->assign("Zipcode",$zipcode);
|
||||||
$smarty->display("./templates/index.tpl");
|
$smarty->display("./templates/index.tpl");
|
||||||
@@ -187,6 +194,18 @@ Example:
|
|||||||
|
|
||||||
--------- templates/index.tpl --------
|
--------- templates/index.tpl --------
|
||||||
{include file="header.tpl" title="Home Page"}
|
{include file="header.tpl" title="Home Page"}
|
||||||
|
<<<<<<< QUICKSTART
|
||||||
|
{if $Name eq ""}
|
||||||
|
Hello, Noname!<br>
|
||||||
|
{elseif $Name eq "Fred"}
|
||||||
|
Hello, Frederick!<br>
|
||||||
|
{else}
|
||||||
|
Hello, {$Name}<br>
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
{$FirstName}, {$LastName}<br>
|
||||||
|
{$Address}, {$Zipcode}
|
||||||
|
=======
|
||||||
{if $Name eq ""}
|
{if $Name eq ""}
|
||||||
Hello, Noname!<br>
|
Hello, Noname!<br>
|
||||||
{elseif $Name eq "Ned"}
|
{elseif $Name eq "Ned"}
|
||||||
@@ -197,6 +216,7 @@ Example:
|
|||||||
|
|
||||||
{$FirstName}, {$LastName}<br>
|
{$FirstName}, {$LastName}<br>
|
||||||
{$Address}, {$Zipcode}
|
{$Address}, {$Zipcode}
|
||||||
|
>>>>>>> 1.2
|
||||||
{include file="footer.tpl"}
|
{include file="footer.tpl"}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -5,6 +5,7 @@
|
|||||||
* File: Smarty.addons.php
|
* File: Smarty.addons.php
|
||||||
* Author: Monte Ohrt <monte@ispi.net>
|
* Author: Monte Ohrt <monte@ispi.net>
|
||||||
* Andrei Zmievski <andrei@ispi.net>
|
* Andrei Zmievski <andrei@ispi.net>
|
||||||
|
* Version: 1.0
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@@ -7,6 +7,7 @@
|
|||||||
*
|
*
|
||||||
* Andrei Zmievski <andrei@ispi.net>
|
* Andrei Zmievski <andrei@ispi.net>
|
||||||
* parsing engine rewrite and a lot more
|
* parsing engine rewrite and a lot more
|
||||||
|
* Version: 1.0
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@@ -12,10 +12,4 @@ $smarty->assign("Class",array(array("A","B","C","D"), array("E", "F", "G", "H"),
|
|||||||
|
|
||||||
$smarty->display("./templates/index.tpl");
|
$smarty->display("./templates/index.tpl");
|
||||||
|
|
||||||
|
|
||||||
function insert_paginate()
|
|
||||||
{
|
|
||||||
echo "test paginate\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
@@ -1,14 +1,17 @@
|
|||||||
{config_load file=test.conf section="my foo"}
|
{config_load file=test.conf section="setup"}
|
||||||
{include file=header.tpl title=foo}
|
{include file=header.tpl title=foo}
|
||||||
|
|
||||||
<PRE>
|
<PRE>
|
||||||
|
|
||||||
|
{* bold and title are read from the config file *}
|
||||||
|
{if #bold#}<b>{/if}
|
||||||
Title: {#title#|capitalize}
|
Title: {#title#|capitalize}
|
||||||
|
{if #bold#}</b>{/if}
|
||||||
|
|
||||||
|
|
||||||
the value of $SCRIPT_NAME is {$SCRIPT_NAME}
|
the value of $SCRIPT_NAME is {$SCRIPT_NAME}
|
||||||
|
|
||||||
{* A simple variable test *}
|
{* A simple variable test. print $Name in uppercase *}
|
||||||
hello, my name is {$Name|upper}
|
hello, my name is {$Name|upper}
|
||||||
|
|
||||||
My interests are:
|
My interests are:
|
||||||
@@ -22,16 +25,14 @@ My interests are:
|
|||||||
none
|
none
|
||||||
{/section}
|
{/section}
|
||||||
|
|
||||||
({$FirstName|@count})
|
<p>
|
||||||
|
|
||||||
{insert name=paginate}
|
|
||||||
|
|
||||||
testing strip tags
|
testing strip tags
|
||||||
{strip}
|
{strip}
|
||||||
<table border=0>
|
<table border=0>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<A HREF="{$url}">
|
<A HREF="{$SCRIPT_NAME}">
|
||||||
<font color="red">This is a test </font>
|
<font color="red">This is a test </font>
|
||||||
</A>
|
</A>
|
||||||
</td>
|
</td>
|
||||||
|
9
doc.sgm
9
doc.sgm
@@ -1762,4 +1762,13 @@ is the first week that has at least 4 days in the current year, and with Monday
|
|||||||
<link linkend="variable.modifiers">modifiers</link>.
|
<link linkend="variable.modifiers">modifiers</link>.
|
||||||
</para>
|
</para>
|
||||||
</chapter>
|
</chapter>
|
||||||
|
<chapter id="credits">
|
||||||
|
<title>CREDITS</title>
|
||||||
|
<para>
|
||||||
|
Monte Ohrt: Original idea an initial implementation, wrote the documentation.
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
Andrei Zmievski: Rewrote parser from scratch, added much functionality.
|
||||||
|
</para>
|
||||||
|
</chapter>
|
||||||
</book>
|
</book>
|
||||||
|
@@ -12,10 +12,4 @@ $smarty->assign("Class",array(array("A","B","C","D"), array("E", "F", "G", "H"),
|
|||||||
|
|
||||||
$smarty->display("./templates/index.tpl");
|
$smarty->display("./templates/index.tpl");
|
||||||
|
|
||||||
|
|
||||||
function insert_paginate()
|
|
||||||
{
|
|
||||||
echo "test paginate\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
@@ -7,6 +7,7 @@
|
|||||||
*
|
*
|
||||||
* Andrei Zmievski <andrei@ispi.net>
|
* Andrei Zmievski <andrei@ispi.net>
|
||||||
* parsing engine rewrite and a lot more
|
* parsing engine rewrite and a lot more
|
||||||
|
* Version: 1.0
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@@ -1,14 +1,17 @@
|
|||||||
{config_load file=test.conf section="my foo"}
|
{config_load file=test.conf section="setup"}
|
||||||
{include file=header.tpl title=foo}
|
{include file=header.tpl title=foo}
|
||||||
|
|
||||||
<PRE>
|
<PRE>
|
||||||
|
|
||||||
|
{* bold and title are read from the config file *}
|
||||||
|
{if #bold#}<b>{/if}
|
||||||
Title: {#title#|capitalize}
|
Title: {#title#|capitalize}
|
||||||
|
{if #bold#}</b>{/if}
|
||||||
|
|
||||||
|
|
||||||
the value of $SCRIPT_NAME is {$SCRIPT_NAME}
|
the value of $SCRIPT_NAME is {$SCRIPT_NAME}
|
||||||
|
|
||||||
{* A simple variable test *}
|
{* A simple variable test. print $Name in uppercase *}
|
||||||
hello, my name is {$Name|upper}
|
hello, my name is {$Name|upper}
|
||||||
|
|
||||||
My interests are:
|
My interests are:
|
||||||
@@ -22,16 +25,14 @@ My interests are:
|
|||||||
none
|
none
|
||||||
{/section}
|
{/section}
|
||||||
|
|
||||||
({$FirstName|@count})
|
<p>
|
||||||
|
|
||||||
{insert name=paginate}
|
|
||||||
|
|
||||||
testing strip tags
|
testing strip tags
|
||||||
{strip}
|
{strip}
|
||||||
<table border=0>
|
<table border=0>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<A HREF="{$url}">
|
<A HREF="{$SCRIPT_NAME}">
|
||||||
<font color="red">This is a test </font>
|
<font color="red">This is a test </font>
|
||||||
</A>
|
</A>
|
||||||
</td>
|
</td>
|
||||||
|
Reference in New Issue
Block a user