cvs: peardoc /ja/package/html/html-template-flexy configuration.xml

From: Date: Tue, 23 Mar 2004 18:26:18 +0000
Subject: cvs: peardoc /ja/package/html/html-template-flexy configuration.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-3065@lists.php.net to get a copy of this message
sousk Tue Mar 23 13:26:18 2004 EDT Added files: /peardoc/ja/package/html/html-template-flexy configuration.xml Log: add japanese edition http://cvs.php.net/co.php/peardoc/ja/package/html/html-template-flexy/configuration.xml?r=1.1&p=1 Index: peardoc/ja/package/html/html-template-flexy/configuration.xml +++ peardoc/ja/package/html/html-template-flexy/configuration.xml <?xml version="1.0" encoding="iso-8859-1" ?> <!-- EN-Revision: 1.7 Maintainer: sousk Status: ready --> <!-- ****************************************** Configuraton file ******************************************* --> <refentry id="package.html.html-template-flexy.configuration"> <refnamediv> <refname>設定項目</refname> <refpurpose> HTML_Template_Flexy の初期設定 </refpurpose> </refnamediv> <refsect1> <title>設定</title> <para> HTML_Template_Flexy には、サイト全体に有効な設定方法と、連想配列を用いたインスタンスごとの設定方法の二通りが用意されています。 ini ファイル使った設定が一番簡単です。(PEAR::Config クラスや、自分で用意した設定方法を使いたい場合は、それも可能です。) </para> <example> <title><classname>HTML_Template_Flexy</classname>の一般的な設定</title> <programlisting role="ini"> [HTML_Template_Flexy] templateDir = /home/me/Projects/myapplication/templates compileDir = /home/me/Projects/myapplication/compiled_templates forceCompile = 0 debug = 0 locale = en compiler = Standard </programlisting> </example> <para> 上記 ini ファイルの設定を HTML_Template_Flexy に適用 (他のクラスでもこのような設定方法が利用できるかも知れません) </para> <example> <title>初期設定</title> <programlisting role="php"><![CDATA[ <?php $config = parse_ini_file('example.ini',TRUE); foreach($config as $class=>$values) { $options = &PEAR::getStaticProperty($class,'options'); $options = $values; } ?> ]]> </programlisting> </example> <para> 他にインスタンス生成時に設定を行う (または既存の設定を上書きする) 方法もあります。 </para> <example> <title>初期設定</title> <programlisting role="php"><![CDATA[ <?php $options = array( 'templateDir' => '/home/me/Projects/myapplication/templates', 'compileDir' => '/home/me/Projects/myapplication/compiled_templates', 'forceCompile' => 0, 'debug' => 0, 'locale' => 'en', 'compiler' => 'Standard', ); $template = new HTML_Template_Flexy($options); ?> ]]> </programlisting> </example> </refsect1> <!-- Config Options --> <refsect1> <title>設定オプション</title> <variablelist> <varlistentry> <term> <parameter>templateDir</parameter> <type>directory</type> </term> <listitem> <para> テンプレートファイルが格納されたディレクトリ </para> </listitem> </varlistentry> <varlistentry> <term> <parameter>compileDir</parameter> <type>directory</type> </term> <listitem> <para> コンパイルされたテンプレートが保存されるディレクトリ、web サーバーにより書き込み可能である事 </para> </listitem> </varlistentry> <varlistentry> <term> <parameter>forceCompile</parameter> <type>boolean</type> </term> <listitem> <para> 通常は 0 に設定され、テンプレートは初回または変更があった場合にのみコンパイルされます。 フィルターの開発や結果のテストが必要な場合にのみ、このオプションが役立ちます。 </para> </listitem> </varlistentry> <varlistentry> <term> <parameter>debug</parameter> <type>integer</type> </term> <listitem> <para> デバッグレベル、初期値は 0 で無効を意味し、1 に設定された場合は絵バッグ用の情報を表示する </para> </listitem> </varlistentry> <varlistentry> <term> <parameter>locale</parameter> <type>string</type> </term> <listitem> <para> 初期値は 'en' で英語を示します。 テンプレートの読み書きにどの言語が使われているかを表しますが、現状ではコンパイルされたファイル名の決定にのみ影響します。 コンパイルされたファイル名 = 例. originalname.html.en.php </para> <para> Flexy は get_text() がインストールされている場合、内部処理で get_text() を用いて全ての文字列を get_text() の戻り値に置き換えます。 - これにより最小の労力で複数言語対応のサイトが作成可能です。 </para> <para> パースされたファイルごとに {templatename}.strings.serial と名付けられたファイルが作成されます。 PHP 関数 unserialize を用いてファイル内の全ての文字列が格納された配列をここから取得し、 翻訳や xgettext で利用する事が出来ます。 </para> </listitem> </varlistentry> <varlistentry> <term> <parameter>compiler</parameter> <type>string</type> </term> <listitem> <para> 初期値は 'Standard' で、標準のトークナイザードライバーエンジンを意味し、 regex (Xipe エンジンに類似した正規表現置換タイプ) のような他のエンジンも利用可能です。 自分で開発した、コアコードとは無縁のエンジンや、完全に分離されたような全くのオリジナルなエンジンも利用できます。 </para> </listitem> </varlistentry> </variablelist> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->

« previous php.pear.doc (#3065) next »