cvs: smarty /docs/ru/appendixes tips.xml /docs/ru/designers language-builtin-functions.xml /docs/ru/programmers advanced-features.xml plugins.xml
"Mehdi Achour" <[email protected]>
| Newsgroups | gmane.comp.php.cvs.smarty |
|---|---|
| Message-ID | <cvsdidou1080639330@cvsserver> |
didou Tue Mar 30 04:35:30 2004 EDT
Modified files:
/smarty/docs/ru/appendixes tips.xml
/smarty/docs/ru/designers language-builtin-functions.xml
/smarty/docs/ru/programmers advanced-features.xml plugins.xml
Log:
more livedocs fixes
--
Smarty CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
didou-20040330043530.txt
(text/plain, 12 KB)
http://cvs.php.net/diff.php/smarty/docs/ru/appendixes/tips.xml?r1=1.2&r2=1.3&ty=u
Index: smarty/docs/ru/appendixes/tips.xml
diff -u smarty/docs/ru/appendixes/tips.xml:1.2 smarty/docs/ru/appendixes/tips.xml:1.3
--- smarty/docs/ru/appendixes/tips.xml:1.2 Tue Mar 30 04:16:43 2004
+++ smarty/docs/ru/appendixes/tips.xml Tue Mar 30 04:35:29 2004
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
<chapter id="tips">
<title>Óëîâêè</title>
<para>
@@ -233,13 +233,14 @@
You can embed PHP into your templates with the {php}{/php} tags.
With this, you can setup self contained templates with their own
data structures for assigning their own variables. With the logic
- embedded like this, you can keep the template & logic together. This
+ embedded like this, you can keep the template & logic together. This
way no matter where the template source is coming from, it is always
together as one component.
</para>
<example>
<title>componentized template</title>
<programlisting>
+<![CDATA[
{* Smarty *}
{php}
@@ -259,7 +260,8 @@
{/php}
-Stock Name: {$ticker_name} Stock Price: {$ticker_price}</programlisting>
+Stock Name: {$ticker_name} Stock Price: {$ticker_price}
+]]></programlisting>
</example>
<para>
As of Smarty 1.5.0, there is even a cleaner way. You can include php in
@@ -271,6 +273,7 @@
<example>
<title>componentized template with include_php</title>
<programlisting>
+<![CDATA[
load_ticker.php
---------------
@@ -297,7 +300,8 @@
{include_php file="load_ticker.php"}
-Stock Name: {$ticker_name} Stock Price: {$ticker_price}</programlisting>
+Stock Name: {$ticker_name} Stock Price: {$ticker_price}
+]]></programlisting>
</example>
</sect1>
<sect1 id="tips.obfuscating.email">
http://cvs.php.net/diff.php/smarty/docs/ru/designers/language-builtin-functions.xml?r1=1.2&r2=1.3&ty=u
Index: smarty/docs/ru/designers/language-builtin-functions.xml
diff -u smarty/docs/ru/designers/language-builtin-functions.xml:1.2 smarty/docs/ru/designers/language-builtin-functions.xml:1.3
--- smarty/docs/ru/designers/language-builtin-functions.xml:1.2 Tue Mar 30 04:16:44 2004
+++ smarty/docs/ru/designers/language-builtin-functions.xml Tue Mar 30 04:35:30 2004
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
<chapter id="language.builtin.functions">
<title>Âñòðîåííûå ôóíêöèè</title>
<para>
@@ -683,6 +683,7 @@
<example>
<title>êîñòðóêöèÿ if</title>
<programlisting>
+<![CDATA[
{if $name eq "Fred"}
Welcome Sir.
{elseif $name eq "Wilma"}
@@ -743,7 +744,9 @@
{* 0=÷åòíî, 1=÷åòíî, 2=÷åòíî, 3=íå÷åòíî, 4=íå÷åòíî, 5=íå÷åòíî, è ò.ä. *}
{if $var is even by 3}
...
-{/if}</programlisting>
+{/if}
+]]>
+</programlisting>
</example>
</sect1>
<sect1 id="language.function.ldelim">
http://cvs.php.net/diff.php/smarty/docs/ru/programmers/advanced-features.xml?r1=1.2&r2=1.3&ty=u
Index: smarty/docs/ru/programmers/advanced-features.xml
diff -u smarty/docs/ru/programmers/advanced-features.xml:1.2 smarty/docs/ru/programmers/advanced-features.xml:1.3
--- smarty/docs/ru/programmers/advanced-features.xml:1.2 Tue Mar 30 04:16:44 2004
+++ smarty/docs/ru/programmers/advanced-features.xml Tue Mar 30 04:35:30 2004
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
<chapter id="advanced.features">
<title>Advanced Features</title>
<sect1 id="advanced.features.objects">
@@ -91,7 +91,8 @@
<example>
<title>using a template prefilter</title>
<programlisting>
-<?php
+<![CDATA[
+<?php
// put this in your application
function remove_dw_comments($tpl_source, &$smarty)
{
@@ -101,10 +102,11 @@
// register the prefilter
$smarty->register_prefilter("remove_dw_comments");
$smarty->display("index.tpl");
-?>
+?>
{* Smarty template index.tpl *}
-<!--# this line will get removed by the prefilter --></programlisting>
+<!--# this line will get removed by the prefilter -->
+]]></programlisting>
</example>
</sect1>
@@ -125,6 +127,7 @@
<example>
<title>using a template postfilter</title>
<programlisting>
+<![CDATA[
<?php
// put this in your application
function add_header_comment($tpl_source, &$smarty)
@@ -139,7 +142,9 @@
{* compiled Smarty template index.tpl *}
<!-- Created by Smarty! -->
-{* rest of template content... *}</programlisting>
+{* rest of template content... *}
+]]>
+</programlisting>
</example>
</sect1>
@@ -166,6 +171,7 @@
<example>
<title>using a template outputfilter</title>
<programlisting>
+<![CDATA[
<?php
// put this in your application
function protect_email($tpl_output, &$smarty)
@@ -182,7 +188,8 @@
// now any occurrence of an email address in the template output will have
// a simple protection against spambots
-?></programlisting>
+?>
+]]></programlisting>
</example>
</sect1>
@@ -211,6 +218,7 @@
<example>
<title>example using MySQL as a cache source</title>
<programlisting>
+<![CDATA[
<?php
/*
@@ -312,7 +320,8 @@
}
-?></programlisting>
+?>
+]]></programlisting>
</example>
</sect1>
@@ -410,6 +419,7 @@
<example>
<title>using custom resources</title>
<programlisting>
+<![CDATA[
// from PHP script
// put these function somewhere in your application
@@ -465,7 +475,8 @@
$smarty->display("db:index.tpl");
{* using resource from within Smarty template *}
-{include file="db:/extras/navigation.tpl"}</programlisting>
+{include file="db:/extras/navigation.tpl"}
+]]></programlisting>
</example>
</sect2>
http://cvs.php.net/diff.php/smarty/docs/ru/programmers/plugins.xml?r1=1.2&r2=1.3&ty=u
Index: smarty/docs/ru/programmers/plugins.xml
diff -u smarty/docs/ru/programmers/plugins.xml:1.2 smarty/docs/ru/programmers/plugins.xml:1.3
--- smarty/docs/ru/programmers/plugins.xml:1.2 Tue Mar 30 04:16:44 2004
+++ smarty/docs/ru/programmers/plugins.xml Tue Mar 30 04:35:30 2004
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
<chapter id="plugins">
<title>Extending Smarty With Plugins</title>
<para>
@@ -324,7 +324,7 @@
<funcdef>void <function>smarty_block_<replaceable>name</replaceable></function></funcdef>
<paramdef>array <parameter>$params</parameter></paramdef>
<paramdef>mixed <parameter>$content</parameter></paramdef>
- <paramdef>object <parameter>&$smarty</parameter></paramdef>
+ <paramdef>object <parameter>&$smarty</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>
@@ -404,7 +404,7 @@
<funcprototype>
<funcdef>mixed <function>smarty_compiler_<replaceable>name</replaceable></function></funcdef>
<paramdef>string <parameter>$tag_arg</parameter></paramdef>
- <paramdef>object <parameter>&$smarty</parameter></paramdef>
+ <paramdef>object <parameter>&$smarty</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>
@@ -421,6 +421,7 @@
<example>
<title>simple compiler function</title>
<programlisting>
+<![CDATA[
<?php
/*
* Smarty plugin
@@ -436,7 +437,8 @@
{
return "\necho '" . $smarty->_current_file . " compiled at " . date('Y-m-d H:M'). "';";
}
-?></programlisting>
+?>
+]]></programlisting>
<para>
This function can be called from the template as:
</para>
@@ -464,7 +466,7 @@
<funcprototype>
<funcdef>string <function>smarty_prefilter_<replaceable>name</replaceable></function></funcdef>
<paramdef>string <parameter>$source</parameter></paramdef>
- <paramdef>object <parameter>&$smarty</parameter></paramdef>
+ <paramdef>object <parameter>&$smarty</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>
@@ -478,7 +480,7 @@
<funcprototype>
<funcdef>string <function>smarty_postfilter_<replaceable>name</replaceable></function></funcdef>
<paramdef>string <parameter>$compiled</parameter></paramdef>
- <paramdef>object <parameter>&$smarty</parameter></paramdef>
+ <paramdef>object <parameter>&$smarty</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>
@@ -492,6 +494,7 @@
<example>
<title>prefilter plugin</title>
<programlisting>
+<![CDATA[
<?php
/*
* Smarty plugin
@@ -506,12 +509,15 @@
{
return preg_replace('!<(\w+)[^>]+>!e', 'strtolower("$1")', $source);
}
-?></programlisting>
+?>
+]]>
+ </programlisting>
</example>
<para></para>
<example>
<title>postfilter plugin</title>
<programlisting>
+<![CDATA[
<?php
/*
* Smarty plugin
@@ -527,7 +533,9 @@
$compiled = "<pre>\n<?php print_r(\$this->get_template_vars()); ?>\n</pre>" . $compiled;
return $compiled;
}
-?></programlisting>
+?>
+]]>
+ </programlisting>
</example>
</sect1>
@@ -540,7 +548,7 @@
<funcprototype>
<funcdef>string <function>smarty_outputfilter_<replaceable>name</replaceable></function></funcdef>
<paramdef>string <parameter>$template_output</parameter></paramdef>
- <paramdef>object <parameter>&$smarty</parameter></paramdef>
+ <paramdef>object <parameter>&$smarty</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>
@@ -551,7 +559,9 @@
</para>
<example>
<title>output filter plugin</title>
- <programlisting>
+ <programlisting role="php">
+<![CDATA[
+<?php
/*
* Smarty plugin
* -------------------------------------------------------------
@@ -567,6 +577,8 @@
return preg_replace('!(\S+)@([a-zA-Z0-9\.\-]+\.([a-zA-Z]{2,3}|[0-9]{1,3}))!',
'$1%40$2', $output);
}
+?>
+]]>
</programlisting>
</example>
</sect1>
@@ -589,24 +601,24 @@
<funcprototype>
<funcdef>bool <function>smarty_resource_<replaceable>name</replaceable>_source</function></funcdef>
<paramdef>string <parameter>$rsrc_name</parameter></paramdef>
- <paramdef>string <parameter>&$source</parameter></paramdef>
- <paramdef>object <parameter>&$smarty</parameter></paramdef>
+ <paramdef>string <parameter>&$source</parameter></paramdef>
+ <paramdef>object <parameter>&$smarty</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>bool <function>smarty_resource_<replaceable>name</replaceable>_timestamp</function></funcdef>
<paramdef>string <parameter>$rsrc_name</parameter></paramdef>
- <paramdef>int <parameter>&$timestamp</parameter></paramdef>
- <paramdef>object <parameter>&$smarty</parameter></paramdef>
+ <paramdef>int <parameter>&$timestamp</parameter></paramdef>
+ <paramdef>object <parameter>&$smarty</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>bool <function>smarty_resource_<replaceable>name</replaceable>_secure</function></funcdef>
<paramdef>string <parameter>$rsrc_name</parameter></paramdef>
- <paramdef>object <parameter>&$smarty</parameter></paramdef>
+ <paramdef>object <parameter>&$smarty</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>bool <function>smarty_resource_<replaceable>name</replaceable>_trusted</function></funcdef>
<paramdef>string <parameter>$rsrc_name</parameter></paramdef>
- <paramdef>object <parameter>&$smarty</parameter></paramdef>
+ <paramdef>object <parameter>&$smarty</parameter></paramdef>
</funcprototype>
</funcsynopsis>
@@ -716,7 +728,7 @@
<funcprototype>
<funcdef>string <function>smarty_insert_<replaceable>name</replaceable></function></funcdef>
<paramdef>array <parameter>$params</parameter></paramdef>
- <paramdef>object <parameter>&$smarty</parameter></paramdef>
+ <paramdef>object <parameter>&$smarty</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>