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