mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-09 12:54:26 +02:00
sync with en.
This commit is contained in:
@@ -1,13 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!-- $Revision$ -->
|
<!-- $Revision$ -->
|
||||||
<!-- EN-Revision: 2590 Maintainer: takagi Status: ready -->
|
<!-- EN-Revision: 2981 Maintainer: takagi Status: ready -->
|
||||||
<!-- CREDITS: mat-sh,daichi,joe -->
|
<!-- CREDITS: mat-sh,daichi,joe -->
|
||||||
<sect1 id="language.modifier.capitalize">
|
<sect1 id="language.modifier.capitalize">
|
||||||
<title>capitalize</title>
|
<title>capitalize</title>
|
||||||
<para>
|
<para>
|
||||||
変数内の全ての単語の先頭を大文字で開始します。
|
変数内の全ての単語の先頭を大文字で開始します。
|
||||||
PHP の <ulink url="&url.php-manual;ucfirst">
|
PHP の <ulink url="&url.php-manual;ucwords">
|
||||||
<varname>ucfirst()</varname></ulink> 関数と似ています。
|
<varname>ucwords()</varname></ulink> 関数と似ています。
|
||||||
</para>
|
</para>
|
||||||
<informaltable frame="all">
|
<informaltable frame="all">
|
||||||
<tgroup cols="5">
|
<tgroup cols="5">
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!-- $Revision$ -->
|
<!-- $Revision$ -->
|
||||||
<!-- EN-Revision: 2675 Maintainer: takagi Status: ready -->
|
<!-- EN-Revision: 3005 Maintainer: takagi Status: ready -->
|
||||||
<!-- CREDITS: mat-sh,daichi,joe -->
|
<!-- CREDITS: mat-sh,daichi,joe -->
|
||||||
<sect1 id="template.resources">
|
<sect1 id="template.resources">
|
||||||
<title>テンプレートリソース</title>
|
<title>テンプレートリソース</title>
|
||||||
@@ -134,33 +134,21 @@ $smarty->display('file:F:/path/to/my/templates/menu.tpl');
|
|||||||
// これらの関数をアプリケーションに追加します
|
// これらの関数をアプリケーションに追加します
|
||||||
function db_get_template ($tpl_name, &$tpl_source, &$smarty_obj)
|
function db_get_template ($tpl_name, &$tpl_source, &$smarty_obj)
|
||||||
{
|
{
|
||||||
// ここでデータベースを呼び出し、取得したテンプレートを
|
// ここでデータベースを呼び出し、取得した実際のテンプレートを
|
||||||
// $tpl_source に代入します
|
// $tpl_source に代入します
|
||||||
$sql = new SQL;
|
$tpl_source = "This is the template text";
|
||||||
$sql->query("select tpl_source
|
// 成功した場合に true を返します。false を返すと失敗したことになります
|
||||||
from my_table
|
return true;
|
||||||
where tpl_name='$tpl_name'");
|
|
||||||
if ($sql->num_rows) {
|
|
||||||
$tpl_source = $sql->record['tpl_source'];
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function db_get_timestamp($tpl_name, &$tpl_timestamp, &$smarty_obj)
|
function db_get_timestamp($tpl_name, &$tpl_timestamp, &$smarty_obj)
|
||||||
{
|
{
|
||||||
|
// テンプレートの最終更新時刻の Unix タイムスタンプを
|
||||||
// $tpl_timestampに代入するためにデータベースを呼び出します
|
// $tpl_timestampに代入するためにデータベースを呼び出します
|
||||||
$sql = new SQL;
|
// これで、再コンパイルが必要かどうかを判断します
|
||||||
$sql->query("select tpl_timestamp
|
$tpl_timestamp = time(); // この例だと常に再コンパイルとなります!
|
||||||
from my_table
|
// 成功した場合に true を返します。false を返すと失敗したことになります
|
||||||
where tpl_name='$tpl_name'");
|
return true;
|
||||||
if ($sql->num_rows) {
|
|
||||||
$tpl_timestamp = $sql->record['tpl_timestamp'];
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function db_get_secure($tpl_name, &$smarty_obj)
|
function db_get_secure($tpl_name, &$smarty_obj)
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!-- $Revision$ -->
|
<!-- $Revision$ -->
|
||||||
<!-- EN-Revision: 2597 Maintainer: takagi Status: ready -->
|
<!-- EN-Revision: 3006 Maintainer: takagi Status: ready -->
|
||||||
<!-- CREDITS: mat-sh,daichi,joe -->
|
<!-- CREDITS: mat-sh,daichi,joe -->
|
||||||
<sect1 id="plugins.resources"><title>リソースプラグイン</title>
|
<sect1 id="plugins.resources"><title>リソースプラグイン</title>
|
||||||
<para>
|
<para>
|
||||||
@@ -94,32 +94,20 @@
|
|||||||
function smarty_resource_db_source($tpl_name, &$tpl_source, &$smarty)
|
function smarty_resource_db_source($tpl_name, &$tpl_source, &$smarty)
|
||||||
{
|
{
|
||||||
// ここでデータベースを呼び出し、
|
// ここでデータベースを呼び出し、
|
||||||
// $tpl_source に代入します
|
// 失際のテンプレートの内容を $tpl_source に代入します
|
||||||
$sql = new SQL;
|
$tpl_source = "This is the template text";
|
||||||
$sql->query("select tpl_source
|
// 成功した場合に true を返します。false を返すと失敗したことになります
|
||||||
from my_table
|
return true;
|
||||||
where tpl_name='$tpl_name'");
|
|
||||||
if ($sql->num_rows) {
|
|
||||||
$tpl_source = $sql->record['tpl_source'];
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function smarty_resource_db_timestamp($tpl_name, &$tpl_timestamp, &$smarty)
|
function smarty_resource_db_timestamp($tpl_name, &$tpl_timestamp, &$smarty)
|
||||||
{
|
{
|
||||||
// ここでデータベースを呼び出し、$tpl_timestampに代入します
|
// テンプレートの最終更新時刻の Unix タイムスタンプを
|
||||||
$sql = new SQL;
|
// $tpl_timestampに代入するためにデータベースを呼び出します
|
||||||
$sql->query("select tpl_timestamp
|
// これで、再コンパイルが必要かどうかを判断します
|
||||||
from my_table
|
$tpl_timestamp = time(); // この例だと常に再コンパイルとなります!
|
||||||
where tpl_name='$tpl_name'");
|
// 成功した場合に true を返します。false を返すと失敗したことになります
|
||||||
if ($sql->num_rows) {
|
return true;
|
||||||
$tpl_timestamp = $sql->record['tpl_timestamp'];
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function smarty_resource_db_secure($tpl_name, &$smarty)
|
function smarty_resource_db_secure($tpl_name, &$smarty)
|
||||||
|
Reference in New Issue
Block a user