mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-01 00:44:26 +02:00
Deployed c94d3dda
to 4.3 with MkDocs 1.4.2 and mike 1.1.2
This commit is contained in:
@@ -3802,7 +3802,7 @@ shorthand way with Smarty, using the
|
||||
<blockquote>
|
||||
<p><strong>Note</strong></p>
|
||||
<p>"Undefined variable" errors will show an E_NOTICE if not disabled in
|
||||
PHP\'s <a href="&url.php-manual;error_reporting"><code>error_reporting()</code></a> level or
|
||||
PHP\'s <a href="https://www.php.net/error_reporting"><code>error_reporting()</code></a> level or
|
||||
Smarty\'s <a href="#variable.error.reporting"><code>$error_reporting</code></a> property and
|
||||
a variable had not been assigned to Smarty.</p>
|
||||
</blockquote>
|
||||
@@ -3870,7 +3870,7 @@ variable modifier.</p>
|
||||
</code></pre></div>
|
||||
<h1 id="dates-tipsdates">Dates {#tips.dates}</h1>
|
||||
<p>As a rule of thumb, always pass dates to Smarty as
|
||||
<a href="&url.php-manual;time">timestamps</a>. This allows template designers to
|
||||
<a href="https://www.php.net/time">timestamps</a>. This allows template designers to
|
||||
use the <a href="#language.modifier.date.format"><code>date_format</code></a> modifier for
|
||||
full control over date formatting, and also makes it easy to compare
|
||||
dates if necessary.</p>
|
||||
|
@@ -3882,7 +3882,7 @@ in /path/to/smarty/libs/sysplugins/smarty_resource.php
|
||||
</code></pre></div>
|
||||
<ul>
|
||||
<li>This means that your application registered a custom error handler
|
||||
(using <a href="&url.php-manual;set_error_handler">set_error_handler()</a>)
|
||||
(using <a href="https://www.php.net/set_error_handler">set_error_handler()</a>)
|
||||
which is not respecting the given <code>$errno</code> as it should. If, for
|
||||
whatever reason, this is the desired behaviour of your custom error
|
||||
handler, please call
|
||||
|
@@ -3799,7 +3799,7 @@
|
||||
<p>Smarty will recognize <a href="#api.assign">assigned</a>
|
||||
<a href="#language.syntax.variables">variables</a> embedded in \"double
|
||||
quotes\" so long as the variable name contains only numbers, letters
|
||||
and under_scores. See <a href="&url.php-manual;language.variables">naming</a>
|
||||
and under_scores. See <a href="https://www.php.net/language.variables">naming</a>
|
||||
for more detail.</p>
|
||||
</li>
|
||||
<li>
|
||||
|
@@ -3795,7 +3795,7 @@
|
||||
|
||||
<h1 id="variables-languagesyntaxvariables">Variables {#language.syntax.variables}</h1>
|
||||
<p>Template variables start with the \$dollar sign. They can contain
|
||||
numbers, letters and underscores, much like a <a href="&url.php-manual;language.variables">PHP
|
||||
numbers, letters and underscores, much like a <a href="https://www.php.net/language.variables">PHP
|
||||
variable</a>. You can reference arrays
|
||||
by index numerically or non-numerically. Also reference object
|
||||
properties and methods.</p>
|
||||
|
@@ -3795,7 +3795,7 @@
|
||||
|
||||
<h1 id="ifelseifelse-languagefunctionif">{if},{elseif},{else} {#language.function.if}</h1>
|
||||
<p><code>{if}</code> statements in Smarty have much the same flexibility as PHP
|
||||
<a href="&url.php-manual;if">if</a> statements, with a few added features for the
|
||||
<a href="https://www.php.net/if">if</a> statements, with a few added features for the
|
||||
template engine. Every <code>{if}</code> must be paired with a matching <code>{/if}</code>.
|
||||
<code>{else}</code> and <code>{elseif}</code> are also permitted. All PHP conditionals and
|
||||
functions are recognized, such as <em>||</em>, <em>or</em>, <em>&&</em>, <em>and</em>,
|
||||
|
@@ -4000,7 +4000,7 @@ arrays, use the <a href="#language.function.foreach"><code>{foreach}</code></a>
|
||||
</li>
|
||||
<li>
|
||||
<p>The <code>name</code> of the <code>{section}</code> can be anything you like, made up of
|
||||
letters, numbers and underscores, like <a href="&url.php-manual;language.variables">PHP
|
||||
letters, numbers and underscores, like <a href="https://www.php.net/language.variables">PHP
|
||||
variables</a>.</p>
|
||||
</li>
|
||||
<li>
|
||||
@@ -4082,7 +4082,7 @@ id: 1000<br />
|
||||
<hr />
|
||||
20 18 16 14 12 10
|
||||
</code></pre></div>
|
||||
<p>The <code>name</code> of the <code>{section}</code> can be anything you like, see <a href="&url.php-manual;language.variables">PHP
|
||||
<p>The <code>name</code> of the <code>{section}</code> can be anything you like, see <a href="https://www.php.net/language.variables">PHP
|
||||
variables</a>. It is used to reference
|
||||
the data within the <code>{section}</code>.</p>
|
||||
<div class="highlight"><pre><span></span><code>{section name=anything loop=$myArray}
|
||||
|
@@ -3795,7 +3795,7 @@
|
||||
|
||||
<h1 id="while-languagefunctionwhile">{while} {#language.function.while}</h1>
|
||||
<p><code>{while}</code> loops in Smarty have much the same flexibility as PHP
|
||||
<a href="&url.php-manual;while">while</a> statements, with a few added features for
|
||||
<a href="https://www.php.net/while">while</a> statements, with a few added features for
|
||||
the template engine. Every <code>{while}</code> must be paired with a matching
|
||||
<code>{/while}</code>. All PHP conditionals and functions are recognized, such as
|
||||
<em>||</em>, <em>or</em>, <em>&&</em>, <em>and</em>, <em>is_array()</em>, etc.</p>
|
||||
|
@@ -3862,7 +3862,7 @@ $smarty->assign('customer_id', 92);
|
||||
?>
|
||||
</code></pre></div>
|
||||
<p>The above arrays would be output with the following template (note the
|
||||
use of the php <a href="&url.php-manual;function.count"><code>count()</code></a> function as a
|
||||
use of the php <a href="https://www.php.net/function.count"><code>count()</code></a> function as a
|
||||
modifier to set the select size).</p>
|
||||
<div class="highlight"><pre><span></span><code><select name="customer_id" size="{$cust_names|@count}">
|
||||
{html_options values=$cust_ids output=$cust_names selected=$customer_id}
|
||||
|
@@ -3802,7 +3802,7 @@ name/value-pairs inside the <code><select></code> tags of day, month and y
|
||||
</code></pre></div>
|
||||
<hr />
|
||||
<div class="highlight"><pre><span></span><code> prefix string No Date\_ What to prefix the var name with
|
||||
time [timestamp](&url.php-manual;function.time), [DateTime](&url.php-manual;class.DateTime), mysql timestamp or any string parsable by [`strtotime()`](&url.php-manual;strtotime), arrays as produced by this function if field\_array is set. No current [timestamp](&url.php-manual;function.time) What date/time to pre-select. If an array is given, the attributes field\_array and prefix are used to identify the array elements to extract year, month and day from. Omitting this parameter or supplying a falsy value will select the current date. To prevent date selection, pass in NULL
|
||||
time [timestamp](https://www.php.net/function.time), [DateTime](https://www.php.net/class.DateTime), mysql timestamp or any string parsable by [`strtotime()`](https://www.php.net/strtotime), arrays as produced by this function if field\_array is set. No current [timestamp](https://www.php.net/function.time) What date/time to pre-select. If an array is given, the attributes field\_array and prefix are used to identify the array elements to extract year, month and day from. Omitting this parameter or supplying a falsy value will select the current date. To prevent date selection, pass in NULL
|
||||
start\_year string No current year The first year in the dropdown, either year number, or relative to current year (+/- N)
|
||||
end\_year string No same as start\_year The last year in the dropdown, either year number, or relative to current year (+/- N)
|
||||
display\_days boolean No TRUE Whether to display days or not
|
||||
|
@@ -3799,12 +3799,12 @@ that creates time dropdowns for you. It can display any or all of hour,
|
||||
minute, second and meridian.</p>
|
||||
<p>The <code>time</code> attribute can have different formats. It can be a unique
|
||||
timestamp, a string of the format <code>YYYYMMDDHHMMSS</code> or a string that is
|
||||
parseable by PHP\'s <a href="&url.php-manual;strtotime"><code>strtotime()</code></a>.</p>
|
||||
parseable by PHP\'s <a href="https://www.php.net/strtotime"><code>strtotime()</code></a>.</p>
|
||||
<div class="highlight"><pre><span></span><code> Attribute Name Type Required Default Description
|
||||
</code></pre></div>
|
||||
<hr />
|
||||
<div class="highlight"><pre><span></span><code> prefix string No Time\_ What to prefix the var name with
|
||||
time [timestamp](&url.php-manual;function.time), [DateTime](&url.php-manual;class.DateTime), mysql timestamp or any string parsable by [`strtotime()`](&url.php-manual;strtotime), arrays as produced by this function if field\_array is set. No current [timestamp](&url.php-manual;function.time) What date/time to pre-select. If an array is given, the attributes field\_array and prefix are used to identify the array elements to extract hour, minute, second and meridian from.
|
||||
time [timestamp](https://www.php.net/function.time), [DateTime](https://www.php.net/class.DateTime), mysql timestamp or any string parsable by [`strtotime()`](https://www.php.net/strtotime), arrays as produced by this function if field\_array is set. No current [timestamp](https://www.php.net/function.time) What date/time to pre-select. If an array is given, the attributes field\_array and prefix are used to identify the array elements to extract hour, minute, second and meridian from.
|
||||
display\_hours boolean No TRUE Whether or not to display hours
|
||||
display\_minutes boolean No TRUE Whether or not to display minutes
|
||||
display\_seconds boolean No TRUE Whether or not to display seconds
|
||||
|
@@ -3809,7 +3809,7 @@ template.</p>
|
||||
<p>+, -, /, *, abs, ceil, cos, exp, floor, log, log10, max, min, pi,
|
||||
pow, rand, round, sin, sqrt, srans and tan are all valid operators.
|
||||
Check the PHP documentation for further information on these
|
||||
<a href="&url.php-manual;eval">math</a> functions.</p>
|
||||
<a href="https://www.php.net/eval">math</a> functions.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>If you supply the <code>assign</code> attribute, the output of the <code>{math}</code>
|
||||
@@ -3820,7 +3820,7 @@ template.</p>
|
||||
<blockquote>
|
||||
<p><strong>Note</strong></p>
|
||||
<p><code>{math}</code> is an expensive function in performance due to its use of the
|
||||
php <a href="&url.php-manual;eval"><code>eval()</code></a> function. Doing the math in PHP
|
||||
php <a href="https://www.php.net/eval"><code>eval()</code></a> function. Doing the math in PHP
|
||||
is much more efficient, so whenever possible do the math calculations
|
||||
in the script and <a href="#api.assign"><code>assign()</code></a> the results to the
|
||||
template. Definitely avoid repetitive <code>{math}</code> function calls, eg
|
||||
|
@@ -3795,7 +3795,7 @@
|
||||
|
||||
<h1 id="capitalize-languagemodifiercapitalize">capitalize {#language.modifier.capitalize}</h1>
|
||||
<p>This is used to capitalize the first letter of all words in a variable.
|
||||
This is similar to the PHP <a href="&url.php-manual;ucwords"><code>ucwords()</code></a>
|
||||
This is similar to the PHP <a href="https://www.php.net/ucwords"><code>ucwords()</code></a>
|
||||
function.</p>
|
||||
<p>Parameter Position Type Required Default Description</p>
|
||||
<hr />
|
||||
|
@@ -3795,11 +3795,11 @@
|
||||
|
||||
<h1 id="date_format-languagemodifierdateformat">date_format {#language.modifier.date.format}</h1>
|
||||
<p>This formats a date and time into the given
|
||||
<a href="&url.php-manual;strftime"><code>strftime()</code></a> format. Dates can be passed to
|
||||
Smarty as unix <a href="&url.php-manual;function.time">timestamps</a>, <a href="&url.php-manual;class.DateTime">DateTime
|
||||
<a href="https://www.php.net/strftime"><code>strftime()</code></a> format. Dates can be passed to
|
||||
Smarty as unix <a href="https://www.php.net/function.time">timestamps</a>, <a href="https://www.php.net/class.DateTime">DateTime
|
||||
objects</a>, mysql timestamps or any string
|
||||
made up of month day year, parsable by php\'s
|
||||
<a href="&url.php-manual;strtotime"><code>strtotime()</code></a>. Designers can then use
|
||||
<a href="https://www.php.net/strtotime"><code>strtotime()</code></a>. Designers can then use
|
||||
<code>date_format</code> to have complete control of the formatting of the date. If
|
||||
the date passed to <code>date_format</code> is empty and a second parameter is
|
||||
passed, that will be used as the date to format.</p>
|
||||
@@ -3822,9 +3822,9 @@ and 14 characters long (<code>YYYYMMDDHHMMSS</code>), mysql timestamps have
|
||||
precedence over unix timestamps.</p>
|
||||
<p><strong>Note</strong></p>
|
||||
<p><code>date_format</code> is essentially a wrapper to PHP\'s
|
||||
<a href="&url.php-manual;strftime"><code>strftime()</code></a> function. You may have more
|
||||
<a href="https://www.php.net/strftime"><code>strftime()</code></a> function. You may have more
|
||||
or less conversion specifiers available depending on your system\'s
|
||||
<a href="&url.php-manual;strftime"><code>strftime()</code></a> function where PHP was
|
||||
<a href="https://www.php.net/strftime"><code>strftime()</code></a> function where PHP was
|
||||
compiled. Check your system\'s manpage for a full list of valid
|
||||
specifiers. However, a few of the specifiers are emulated on Windows.
|
||||
These are: %D, %e, %h, %l, %n, %r, %R, %t, %T.</p>
|
||||
@@ -3985,7 +3985,7 @@ Monday, December 1, 2021
|
||||
</li>
|
||||
</ul>
|
||||
<p>See also <a href="#language.variables.smarty.now"><code>$smarty.now</code></a>,
|
||||
<a href="&url.php-manual;strftime"><code>strftime()</code></a>,
|
||||
<a href="https://www.php.net/strftime"><code>strftime()</code></a>,
|
||||
<a href="#language.function.html.select.date"><code>{html_select_date}</code></a> and the
|
||||
<a href="#tips.dates">date tips</a> page.</p>
|
||||
|
||||
|
@@ -3800,7 +3800,7 @@ its <code>html</code>.</p>
|
||||
<p>Parameter Position Type Required Possible Values Default Description</p>
|
||||
<hr />
|
||||
<div class="highlight"><pre><span></span><code> 1 string No `html`, `htmlall`, `url`, `urlpathinfo`, `quotes`, `hex`, `hexentity`, `javascript`, `mail` `html` This is the escape format to use.
|
||||
2 string No `ISO-8859-1`, `UTF-8`, and any character set supported by [`htmlentities()`](&url.php-manual;htmlentities) `UTF-8` The character set encoding passed to htmlentities() et. al.
|
||||
2 string No `ISO-8859-1`, `UTF-8`, and any character set supported by [`htmlentities()`](https://www.php.net/htmlentities) `UTF-8` The character set encoding passed to htmlentities() et. al.
|
||||
3 boolean No FALSE TRUE Double encode entites from &amp; to &amp;amp; (applys to `html` and `htmlall` only)
|
||||
|
||||
|
||||
|
@@ -3799,7 +3799,7 @@ internal charset. This is the exact opposite of the <a href="#language.modifier.
|
||||
modifier</a>.</p>
|
||||
<p>Parameter Position Type Required Possible Values Default Description</p>
|
||||
<hr />
|
||||
<div class="highlight"><pre><span></span><code> 1 string No `ISO-8859-1`, `UTF-8`, and any character set supported by [`mb_convert_encoding()`](&url.php-manual;mb_convert_encoding) `ISO-8859-1` The charset encoding the value is supposed to be decoded from
|
||||
<div class="highlight"><pre><span></span><code> 1 string No `ISO-8859-1`, `UTF-8`, and any character set supported by [`mb_convert_encoding()`](https://www.php.net/mb_convert_encoding) `ISO-8859-1` The charset encoding the value is supposed to be decoded from
|
||||
</code></pre></div>
|
||||
<blockquote>
|
||||
<p><strong>Note</strong></p>
|
||||
|
@@ -3795,7 +3795,7 @@
|
||||
|
||||
<h1 id="lower-languagemodifierlower">lower {#language.modifier.lower}</h1>
|
||||
<p>This is used to lowercase a variable. This is equivalent to the PHP
|
||||
<a href="&url.php-manual;strtolower"><code>strtolower()</code></a> function.</p>
|
||||
<a href="https://www.php.net/strtolower"><code>strtolower()</code></a> function.</p>
|
||||
<div class="highlight"><pre><span></span><code><?php
|
||||
|
||||
$smarty->assign('articleTitle', 'Two Convicts Evade Noose, Jury Hung.');
|
||||
|
@@ -3796,7 +3796,7 @@
|
||||
<h1 id="nl2br-languagemodifiernl2br">nl2br {#language.modifier.nl2br}</h1>
|
||||
<p>All <code>"\n"</code> line breaks will be converted to html <code><br /></code> tags in the
|
||||
given variable. This is equivalent to the PHP\'s
|
||||
<a href="&url.php-manual;nl2br"><code>nl2br()</code></a> function.</p>
|
||||
<a href="https://www.php.net/nl2br"><code>nl2br()</code></a> function.</p>
|
||||
<div class="highlight"><pre><span></span><code><?php
|
||||
|
||||
$smarty->assign('articleTitle',
|
||||
|
@@ -3795,7 +3795,7 @@
|
||||
|
||||
<h1 id="regex_replace-languagemodifierregexreplace">regex_replace {#language.modifier.regex.replace}</h1>
|
||||
<p>A regular expression search and replace on a variable. Use the
|
||||
<a href="&url.php-manual;preg_replace"><code>preg_replace()</code></a> syntax from the PHP
|
||||
<a href="https://www.php.net/preg_replace"><code>preg_replace()</code></a> syntax from the PHP
|
||||
manual.</p>
|
||||
<blockquote>
|
||||
<p><strong>Note</strong></p>
|
||||
|
@@ -3795,7 +3795,7 @@
|
||||
|
||||
<h1 id="replace-languagemodifierreplace">replace {#language.modifier.replace}</h1>
|
||||
<p>A simple search and replace on a variable. This is equivalent to the
|
||||
PHP\'s <a href="&url.php-manual;str_replace"><code>str_replace()</code></a> function.</p>
|
||||
PHP\'s <a href="https://www.php.net/str_replace"><code>str_replace()</code></a> function.</p>
|
||||
<p>Parameter Position Type Required Default Description</p>
|
||||
<hr />
|
||||
<div class="highlight"><pre><span></span><code> 1 string Yes *n/a* This is the string of text to be replaced.
|
||||
|
@@ -3795,7 +3795,7 @@
|
||||
|
||||
<h1 id="string_format-languagemodifierstringformat">string_format {#language.modifier.string.format}</h1>
|
||||
<p>This is a way to format strings, such as decimal numbers and such. Use
|
||||
the syntax for <a href="&url.php-manual;sprintf"><code>sprintf()</code></a> for the
|
||||
the syntax for <a href="https://www.php.net/sprintf"><code>sprintf()</code></a> for the
|
||||
formatting.</p>
|
||||
<p>Parameter Position Type Required Default Description</p>
|
||||
<hr />
|
||||
|
@@ -3799,7 +3799,7 @@ a given charset. This is the exact opposite of the <a href="#language.modifier.f
|
||||
modifier</a>.</p>
|
||||
<p>Parameter Position Type Required Possible Values Default Description</p>
|
||||
<hr />
|
||||
<div class="highlight"><pre><span></span><code> 1 string No `ISO-8859-1`, `UTF-8`, and any character set supported by [`mb_convert_encoding()`](&url.php-manual;mb_convert_encoding) `ISO-8859-1` The charset encoding the value is supposed to be encoded to
|
||||
<div class="highlight"><pre><span></span><code> 1 string No `ISO-8859-1`, `UTF-8`, and any character set supported by [`mb_convert_encoding()`](https://www.php.net/mb_convert_encoding) `ISO-8859-1` The charset encoding the value is supposed to be encoded to
|
||||
</code></pre></div>
|
||||
<blockquote>
|
||||
<p><strong>Note</strong></p>
|
||||
|
@@ -3800,7 +3800,7 @@ given types.</p>
|
||||
<p>Parameter Position Type Required Possible Values Default Description</p>
|
||||
<hr />
|
||||
<div class="highlight"><pre><span></span><code> 1 string No `html`, `htmlall`, `entity`, `html` This is the escape format to use.
|
||||
2 string No `ISO-8859-1`, `UTF-8`, and any character set supported by [`htmlentities()`](&url.php-manual;htmlentities) `UTF-8` The character set encoding passed to html\_entity\_decode() or htmlspecialchars\_decode() or mb\_convert\_encoding() et. al.
|
||||
2 string No `ISO-8859-1`, `UTF-8`, and any character set supported by [`htmlentities()`](https://www.php.net/htmlentities) `UTF-8` The character set encoding passed to html\_entity\_decode() or htmlspecialchars\_decode() or mb\_convert\_encoding() et. al.
|
||||
|
||||
|
||||
<?php
|
||||
|
@@ -3795,7 +3795,7 @@
|
||||
|
||||
<h1 id="upper-languagemodifierupper">upper {#language.modifier.upper}</h1>
|
||||
<p>This is used to uppercase a variable. This is equivalent to the PHP
|
||||
<a href="&url.php-manual;strtoupper"><code>strtoupper()</code></a> function.</p>
|
||||
<a href="https://www.php.net/strtoupper"><code>strtoupper()</code></a> function.</p>
|
||||
<div class="highlight"><pre><span></span><code><?php
|
||||
$smarty->assign('articleTitle', "If Strike isn't Settled Quickly it may Last a While.");
|
||||
?>
|
||||
|
@@ -3800,7 +3800,7 @@ the next line, the default is a carriage return <code>"\n"</code>. By default,
|
||||
<code>wordwrap</code> will attempt to wrap at a word boundary. If you want to cut
|
||||
off at the exact character length, pass the optional third parameter as
|
||||
TRUE. This is equivalent to the PHP
|
||||
<a href="&url.php-manual;wordwrap"><code>wordwrap()</code></a> function.</p>
|
||||
<a href="https://www.php.net/wordwrap"><code>wordwrap()</code></a> function.</p>
|
||||
<p>Parameter Position Type Required Default Description</p>
|
||||
<hr />
|
||||
<div class="highlight"><pre><span></span><code> 1 integer No 80 This determines how many columns to wrap to.
|
||||
|
@@ -4011,7 +4011,7 @@
|
||||
<p>The PHP reserved <code>{$smarty}</code> variable can be used to access several
|
||||
environment and request variables. The full list of them follows.</p>
|
||||
<h2 id="request-variables-languagevariablessmartyrequest">Request variables {#language.variables.smarty.request}</h2>
|
||||
<p>The <a href="&url.php-manual;reserved.variables">request variables</a> such as
|
||||
<p>The <a href="https://www.php.net/reserved.variables">request variables</a> such as
|
||||
<code>$_GET</code>, <code>$_POST</code>, <code>$_COOKIE</code>, <code>$_SERVER</code>, <code>$_ENV</code> and <code>$_SESSION</code> can
|
||||
be accessed as demonstrated in the examples below:</p>
|
||||
<div class="highlight"><pre><span></span><code>{* display value of page from URL ($_GET) http://www.example.com/index.php?page=foo *}
|
||||
@@ -4049,11 +4049,11 @@ globals mixes underlying application code structure with templates. A
|
||||
good practice is to assign specific needed values to template vars.</p>
|
||||
</blockquote>
|
||||
<h2 id="smartynow-languagevariablessmartynow">{\$smarty.now} {#language.variables.smarty.now}</h2>
|
||||
<p>The current <a href="&url.php-manual;function.time">timestamp</a> can be accessed
|
||||
<p>The current <a href="https://www.php.net/function.time">timestamp</a> can be accessed
|
||||
with <code>{$smarty.now}</code>. The value reflects the number of seconds passed
|
||||
since the so-called Epoch on January 1, 1970, and can be passed directly
|
||||
to the <a href="#language.modifier.date.format"><code>date_format</code></a> modifier for
|
||||
display. Note that <a href="&url.php-manual;function.time"><code>time()</code></a> is called
|
||||
display. Note that <a href="https://www.php.net/function.time"><code>time()</code></a> is called
|
||||
on each invocation; eg a script that takes three seconds to execute with
|
||||
a call to <code>$smarty.now</code> at start and end will show the three second
|
||||
difference.</p>
|
||||
|
@@ -3794,7 +3794,7 @@
|
||||
|
||||
|
||||
<h1 id="objects-advancedfeaturesobjects">Objects {#advanced.features.objects}</h1>
|
||||
<p>Smarty allows access to PHP <a href="&url.php-manual;object">objects</a> through
|
||||
<p>Smarty allows access to PHP <a href="https://www.php.net/object">objects</a> through
|
||||
the templates.</p>
|
||||
<blockquote>
|
||||
<p><strong>Note</strong></p>
|
||||
|
@@ -3843,7 +3843,7 @@ at 40 characters. This helps make the text easier to read in mail programs that
|
||||
do not wrap sentences for you.
|
||||
{/textformat}
|
||||
</code></pre></div>
|
||||
<p>The php script using the PHP <a href="&url.php-manual;function.mail"><code>mail()</code></a>
|
||||
<p>The php script using the PHP <a href="https://www.php.net/function.mail"><code>mail()</code></a>
|
||||
function</p>
|
||||
<div class="highlight"><pre><span></span><code><?php
|
||||
|
||||
|
@@ -3798,7 +3798,7 @@
|
||||
<p>string</p>
|
||||
<p>muteExpectedErrors</p>
|
||||
<p>muteExpectedErrors() registers a custom error handler using
|
||||
<a href="&url.php-manual;set_error_handler">set_error_handler()</a>. The error
|
||||
<a href="https://www.php.net/set_error_handler">set_error_handler()</a>. The error
|
||||
handler merely inspects <code>$errno</code> and <code>$errfile</code> to determine if the
|
||||
given error was produced deliberately and must be ignored, or should be
|
||||
passed on to the next error handler.</p>
|
||||
|
@@ -3795,7 +3795,7 @@
|
||||
|
||||
<h1 id="error_reporting-variableerrorreporting">\$error_reporting {#variable.error.reporting}</h1>
|
||||
<p>When this value is set to a non-null-value it\'s value is used as php\'s
|
||||
<a href="&url.php-manual;error_reporting"><code>error_reporting</code></a> level inside of
|
||||
<a href="https://www.php.net/error_reporting"><code>error_reporting</code></a> level inside of
|
||||
<a href="#api.display"><code>display()</code></a> and <a href="#api.fetch"><code>fetch()</code></a>.</p>
|
||||
<p>Smarty 3.1.2 introduced the
|
||||
<a href="#api.mute.expected.errors"><code>muteExpectedErrors()</code></a> function. Calling
|
||||
|
@@ -3808,7 +3808,7 @@ document root.</p>
|
||||
<p><strong>Note</strong></p>
|
||||
<p>If the directories known to <code>$template_dir</code> are relative to
|
||||
directories known to the
|
||||
<a href="&url.php-manual;ini.core.php#ini.include-path">include_path</a> you
|
||||
<a href="https://www.php.net/ini.core.php#ini.include-path">include_path</a> you
|
||||
need to activate the <a href="#variable.use.include.path"><code>$use_include_path</code></a>
|
||||
option.</p>
|
||||
<p><strong>Note</strong></p>
|
||||
|
@@ -3795,7 +3795,7 @@
|
||||
|
||||
<h1 id="use_include_path-variableuseincludepath">\$use_include_path {#variable.use.include.path}</h1>
|
||||
<p>This tells smarty to respect the
|
||||
<a href="&url.php-manual;ini.core.php#ini.include-path">include_path</a> within
|
||||
<a href="https://www.php.net/ini.core.php#ini.include-path">include_path</a> within
|
||||
the <a href="#resources.file"><code>File Template Resource</code></a> handler and the plugin
|
||||
loader to resolve the directories known to
|
||||
<a href="#variable.template.dir"><code>$template_dir</code></a>. The flag also makes the
|
||||
@@ -3816,7 +3816,7 @@ as this may - depending on your implementation - slow down your system
|
||||
\$plugins_dir) do</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>Test if requested file is in <code>$directory</code> relative to the <a href="&url.php-manual;function.getcwd.php">current
|
||||
<p>Test if requested file is in <code>$directory</code> relative to the <a href="https://www.php.net/function.getcwd.php">current
|
||||
working directory</a>. If file
|
||||
found, return it.</p>
|
||||
</li>
|
||||
@@ -3825,7 +3825,7 @@ as this may - depending on your implementation - slow down your system
|
||||
</li>
|
||||
<li>
|
||||
<p>Test if requested file is in <code>$directory</code> relative to the <code>$path</code>
|
||||
(possibly relative to the <a href="&url.php-manual;function.getcwd.php">current working
|
||||
(possibly relative to the <a href="https://www.php.net/function.getcwd.php">current working
|
||||
directory</a>). If file found,
|
||||
return it.</p>
|
||||
</li>
|
||||
|
@@ -3812,7 +3812,7 @@ almost nothing.</p>
|
||||
<ul>
|
||||
<li>
|
||||
<p><code>$use_sub_dirs=true</code> doesn\'t work with
|
||||
<a href="&url.php-manual;features.safe-mode">safe_mode=On</a>, that\'s why
|
||||
<a href="https://www.php.net/features.safe-mode">safe_mode=On</a>, that\'s why
|
||||
it\'s switchable and why it\'s off by default.</p>
|
||||
</li>
|
||||
<li>
|
||||
|
@@ -3850,7 +3850,7 @@ cannot have both custom function <code>{func}</code> and block function
|
||||
</ul>
|
||||
<p>If you have nested block functions, it\'s possible to find out what the
|
||||
parent block function is by accessing <code>$smarty->_tag_stack</code> variable.
|
||||
Just do a <a href="&url.php-manual;var_dump"><code>var_dump()</code></a> on it and the
|
||||
Just do a <a href="https://www.php.net/var_dump"><code>var_dump()</code></a> on it and the
|
||||
structure should be apparent.</p>
|
||||
<div class="highlight"><pre><span></span><code><?php
|
||||
/*
|
||||
|
@@ -3808,7 +3808,7 @@ other context. Modifiers can be chained together.</p>
|
||||
<p>The first parameter to the modifier plugin is the value on which the
|
||||
modifier is to operate. The rest of the parameters are optional,
|
||||
depending on what kind of operation is to be performed.</p>
|
||||
<p>The modifier has to <a href="&url.php-manual;return">return</a> the result of its
|
||||
<p>The modifier has to <a href="https://www.php.net/return">return</a> the result of its
|
||||
processing.</p>
|
||||
<p>This plugin basically aliases one of the built-in PHP functions. It does
|
||||
not have any additional parameters.</p>
|
||||
|
@@ -3835,7 +3835,7 @@ in order to be located by Smarty.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>And <code>name</code> should be a valid identifier; letters, numbers, and
|
||||
underscores only, see <a href="&url.php-manual;language.variables">php
|
||||
underscores only, see <a href="https://www.php.net/language.variables">php
|
||||
variables</a>.</p>
|
||||
</li>
|
||||
<li>
|
||||
|
@@ -3893,7 +3893,7 @@ is invoked.</p>
|
||||
<blockquote>
|
||||
<p><strong>Note</strong></p>
|
||||
<p>As of Smarty 3.1 the file resource no longer walks through the
|
||||
<a href="&url.php-manual;ini.core.php#ini.include-path">include_path</a> unless
|
||||
<a href="https://www.php.net/ini.core.php#ini.include-path">include_path</a> unless
|
||||
<a href="#variable.use.include.path"><code>$use_include_path</code> is activated</a></p>
|
||||
</blockquote>
|
||||
<h2 id="templates-from-template_dir-templatesfromtemplatedir">Templates from \$template_dir {#templates.from.template.dir}</h2>
|
||||
|
@@ -3834,8 +3834,8 @@ $smarty->display('eval:'.$template_string); // compiles every time
|
||||
{include file="eval:$template_string"} {* compiles every time *}
|
||||
</code></pre></div>
|
||||
<p>Both <code>string:</code> and <code>eval:</code> resources may be encoded with
|
||||
<a href="&url.php-manual;urlencode"><code>urlencode()</code></a> or
|
||||
<a href="&url.php-manual;urlencode"><code>base64_encode()</code></a>. This is not necessary
|
||||
<a href="https://www.php.net/urlencode"><code>urlencode()</code></a> or
|
||||
<a href="https://www.php.net/urlencode"><code>base64_encode()</code></a>. This is not necessary
|
||||
for the usual use of <code>string:</code> and <code>eval:</code>, but is required when using
|
||||
either of them in conjunction with
|
||||
<a href="#resources.extends"><code>Extends Template Resource</code></a></p>
|
||||
|
File diff suppressed because one or more lines are too long
Binary file not shown.
Reference in New Issue
Block a user