class.rFastTemplate.php一_PHP教程

Jul 13, 2016 pm 05:24 PM
multi 1つ

// 2001 Alister Bulman Re-Port multi template-roots + more // PHP3 Port: Copyright ?1999 CDI , All Rights Reserved. // Perl Version: Copyright ?1998 Jason Moore , All Rights Reserved. // // RCS Revision // @(#) $Id: class.rFastTemplate.php,v 1.22 2001/10/18 21:36:53 roland Exp $ // $Source: /home/cvs/projects/php/tools/class.rFastTemplate.php,v $ // // Copyright Notice // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2, or (at your option) // any later version. // // class.rFastTemplate.php is distributed in the hope that it will be // useful, but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // General Public License for more details. // // Comments // // I would like to thank CDI for pointing out the // copyright notice attached to his PHP3 port which I had blindly missed // in my first release of this code. // // This work is derived from class.FastTemplate.php3 version 1.1.0 as // available from http://www.thewebmasters.net/. That work makes // reference to the "GNU General Artistic License". In correspondence // with the author, the intent was to use the GNU General Public License; // this work does the same. // // Authors // // Roland Roberts // Alister Bulman (multi template-roots) // Michal Rybarik (define_raw()) // CDI , PHP3 port // Jason Moore , original Perl version // // Synopsis // // require ("PATH-TO-TEMPLATE-CODE/class.Template.php"); // $t = new Template("PATH-TO-TEMPLATE-DIRECTORY"); // $t->define (array(MAIN => "diary.html")); // $t->setkey (VAR1, "some text"); // $t->subst (INNER, "inner") // $t->setkey (VAR1, "some more text"); // $t->subst (INNER, ".inner") // $t->setkey (VAR2, "var2 text"); // $t->subst (CONTENT, "main"); // $t->print (CONTENT); // // Description // // This is a class.FastTemplate.php3 replacement that provides most of the // same interface but has the ability to do nested dynamic templates. The // default is to do dynamic template expansion and no special action is // required for this to happen. // // class.FastTemplate.php3 Methods Not Implemented // // clear_parse // Same as clear. In fact, it was the same as clear in FastTemplate. // clear_all // If you really think you need this, try // unset $t; // $t = new Template ($path); // which gives the same effect. // clear_tpl // Use unload instead. This has the side effect of unloading all parent // and sibling templates which may be more drastic than you expect and // is different from class.FastTemplate.php3. This difference is // necessary since the only way we can force the reload of an embedded // template is to force the reload of the parent and sibling templates. // // class.FastTemplate.php3 Methods by Another Name // // The existence of these functions is a historical artifact. I // originally had in mind to write a functional equivalent from scratch. // Then I came my senses and just grabbed class.FastTemplate.php3 and // started hacking it. So, you can use the names on the right, but the // ones on the left are equivalent and are the names used in the original // class.FastTemplate.php3. // // parse --> subst // get_assiged --> getkey // assign --> setkey // clear_href --> unsetkey // clear_assign --> unsetkey // FastPrint --> xprint // class rFastTemplate { // File name to be used for debugging output. Needs to be set prior to // calling anything other than option setting commands (debug, debugall, // strict, dynamic) because once the file has been opened, this is ignored. var $DEBUGFILE = /tmp/class.rFastTemplate.php.dbg; // File descriptor for debugging output. var $DEBUGFD = -1; // Array for individual member functions. You can turn on debugging for a // particular member function by calling $this->debug(FUNCTION_NAME) var $DEBUG = array (); // Turn this on to turn on debugging in all member functions via // $this->debugall(). Turn if off via $this->debugall(false); var $DEBUGALL = false; // Names of actual templates. Each element will be an array with template // information including is originating file, file load status, parent // template, variable list, and actual template contents. var $TEMPLATE = array(); // Holds paths-to-templates (See: set_root and FindTemplate) var $ROOT = array(); // Holds the HANDLE to the last template parsed by parse() var $LAST = ; // Strict template checking. Unresolved variables in templates will generate a // warning. var $STRICT = true; // If true, this suppresses the warning generated by $STRICT=true. var $QUIET = false; // Holds handles assigned by a call to parse(). var $HANDLE = array(); // Holds all assigned variable names and values. var $VAR = array(); // Set to true is this is a WIN32 server. This was part of the // class.FastTemplate.php3 implementation and the only real place it kicks // in is in setting the terminating character on the value of $ROOT, the // path where all the templates live. var $WIN32 = false; // Automatically scan template for dynamic templates and assign new values // to TEMPLATE based on whatever names the HTML comments use. This can be // changed up until the time the first parse() is called. Well, you can // change it anytime, but it will have no effect on already loaded // templates. Also, if you have dynamic templates, the first call to parse // will load ALL of your templates, so changing it after that point will // have no effect on any defined templates. var $DYNAMIC = true; // Grrr. Dont try to break these extra long regular expressions into // multiple lines for readability. PHP 4.03pl1 chokes on them if you do. // Im guessing the reason is something obscure with the parenthesis // matching, the same sort of thing Tcl might have, but Im not sure. // Regular expression which matches the beginning of a dynamic/inferior // template. The critical bit is that we need two parts: (1) the entire // match, and (2) the name of the dynamic template. The first part is // required because will do a strstr() to split the buffer into two // pieces: everything before the dynamic template declaration and // everything after. The second is needed because after finding a BEGIN // we will search for an END and they both have to have the same name of // we consider the template malformed and throw and error. // Both of these are written with PCRE (Perl-Compatible Regular // Expressions) because we need the non-greedy operators to insure that // we dont read past the end of the HTML comment marker in the case that // the BEGIN/END block have trailing comments after the tag name. var $REGEX_DYNBEG = /()/; // Regular expression which matches the end of a dynamic/inferior // template; see the comment about on the BEGIN match. var $REGEX_DYNEND = /()/; // Regular expression which matches a variable in the template. var $REGEX_VAR = /{[A-Za-z][-_A-Za-z0-9]*}/; // // Description // Constructor. // function rFastTemplate ($pathToTemplates = ) { // $pathToTemplates can also be an array of template roots, handled in set_root global $php_errormsg; if (!empty($pathToTemplates)) { $this->set_root ($pathToTemplates); } $this->DEBUG = array (subst => false, parse_internal => false, parse_internal_1 => false, parsed => false, clear => false, clear_dynamic => false, load => false); return $this; } // // Description // Set the name to be u

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/532115.htmlTechArticle// 2001 Alister Bulman Re-Port multi template-roots + more // PHP3 Port: Copyright ?1999 CDI , All Rights Reserved. // Perl Version: Copyright ?1998 Jason Moore , All Rights Reserv...
このウェブサイトの声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。

ホットAIツール

Undresser.AI Undress

Undresser.AI Undress

リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover

AI Clothes Remover

写真から衣服を削除するオンライン AI ツール。

Undress AI Tool

Undress AI Tool

脱衣画像を無料で

Clothoff.io

Clothoff.io

AI衣類リムーバー

Video Face Swap

Video Face Swap

完全無料の AI 顔交換ツールを使用して、あらゆるビデオの顔を簡単に交換できます。

ホットツール

メモ帳++7.3.1

メモ帳++7.3.1

使いやすく無料のコードエディター

SublimeText3 中国語版

SublimeText3 中国語版

中国語版、とても使いやすい

ゼンドスタジオ 13.0.1

ゼンドスタジオ 13.0.1

強力な PHP 統合開発環境

ドリームウィーバー CS6

ドリームウィーバー CS6

ビジュアル Web 開発ツール

SublimeText3 Mac版

SublimeText3 Mac版

神レベルのコード編集ソフト(SublimeText3)

kvr800d2n6はDDR3と互換性がありますか? (kvr800d2n6 は 4GB バージョンを提供しますか) kvr800d2n6はDDR3と互換性がありますか? (kvr800d2n6 は 4GB バージョンを提供しますか) Jan 09, 2024 pm 10:33 PM

kvr800d2n6 は ddr3 で使用できますか? いいえ。 1. kvr800d2n6 は DDR2 メモリ モジュールであり、DDR3 は別のタイプのメモリ モジュールであるため、この 2 つは互換性がありません。 2. DDR2 と DDR3 のスロット形状は同じですが、電圧、タイミング、転送速度などが異なるため、異なる種類のメモリ モジュールを相互運用することはできません。 kvr800d2n6 は数世代のメモリースティックです。内容を書き換える場合、元の意味を変えずに言語を中国語に変更する必要があります。 kvr800 メモリの内容を書き換える場合、元の意味を変えずに言語を中国語に変更する必要があります。 (DDR2) メモリ メイン周波数は 800mhz です。 kvr800d2n62g はキングストン KVR800 です

データ処理初心者もすぐに上達できるPython Pandas実践ドリル! データ処理初心者もすぐに上達できるPython Pandas実践ドリル! Mar 20, 2024 pm 10:21 PM

read_csv() を使用して CSV ファイルを読み取ります: df=pd.read_csv("data.csv") 欠損値の処理: 欠損値を削除します: df=df.dropna() 欠損値を埋める: df["column_name"].fillna( value ) データ型の変換: df["column_name"]=df["column_name"].astype(dtype) 並べ替えとグループ化: 並べ替え: df.sort_values(by="column_name") グループ化: groupby_object=df.groupby(by= "列名

MULTIとはどのような通貨で、その利点は何ですか? MULTIとはどのような通貨で、その利点は何ですか? Jan 31, 2024 pm 04:23 PM

MULTIコインは、スマートコントラクト技術に基づいて構築された分散型デジタル通貨で、高速、便利、低コストの資産移転および交換サービスを提供することを目的としています。その利点: 1. 分散化、2. 国境を越えた支払い、3. 低コスト、4. プライバシー保護、5. グローバル性。

PHP PDO の高度なヒント: ストアド プロシージャとトランザクションの使用 PHP PDO の高度なヒント: ストアド プロシージャとトランザクションの使用 Feb 20, 2024 am 10:01 AM

ストアド プロシージャは、プリコンパイルされてデータベース サーバーに保存される SQL ステートメントです。ストアド プロシージャを実行する必要がある場合、SQL ステートメントを書き直すことなく、ストアド プロシージャの名前を呼び出すだけで済みます。ストアド プロシージャを使用すると、特に複雑な SQL ステートメントや反復的な SQL ステートメントを実行する必要がある場合に、コードの読みやすさと効率が向上します。 1. ストアド プロシージャ CREATEPROCEDUREget_customer_by_id(INcustomer_idINT)BEGINSELECT*FROMcustomersWHEREcustomer_id=customer_id;END2 を作成します。ストアド プロシージャ $stmt=$pdo->prepare(

Java 例外処理のマスターになる: コード内のエラーを制御する Java 例外処理のマスターになる: コード内のエラーを制御する Mar 24, 2024 pm 04:06 PM

Java の例外処理システムは、最も一般的な Throwable クラスから、Exception や Error などのより具体的なサブクラスまでの階層構造に従います。この階層を理解することは、例外の処理方法とその範囲を決定するため、非常に重要です。 2. 例外伝播メカニズムをマスターする 例外がプログラム内で伝播すると、コール スタックを上に移動します。例外がコード内で処理されない場合、例外はそれを呼び出したメソッドに伝播されます。例外が適切に処理されるようにするには、例外の伝播メカニズムを理解することが重要です。 3. try-catch-finally ブロックを使用する try-catch-finally ブロックは、Java で例外を処理するための推奨メカニズムです。 try ブロックには実行する必要のあるコードが含まれていますが、

どのAKが反戦で最高ですか(反戦でのAKのランキング) どのAKが反戦で最高ですか(反戦でのAKのランキング) Jan 07, 2024 pm 06:34 PM

どの AK が反戦に最適であるか: AK47 は、世界中の軍隊やテロ組織によって広く使用されている非常に有名なライフルです。優れた性能と信頼性で知られ、世界最高のアサルトライフルのひとつとみなされています。 AK47 のデザインはシンプルかつ実用的で、さまざまな過酷な環境での使用に適しています。射程距離と貫通力が高い7.62mm口径弾を使用する。 AK47 は製造コストが安く、メンテナンスと操作が簡単なため、人気があります。設計にはいくつかの制限がありますが、それでも非常に信頼性が高く効果的な武器です。軍事作戦でも個人防衛でも、AK47 は強力な選択肢です。反戦における最も古典的な銃器は間違いなく AK47 です。モール内でのAK47の常時販売価格は

Java 文法の神殿: 文法への巡礼の旅に出て、プログラミングの可能性を解き放ちましょう Java 文法の神殿: 文法への巡礼の旅に出て、プログラミングの可能性を解き放ちましょう Mar 30, 2024 pm 01:01 PM

変数宣言により、変数名、型、スコープが決まります。 Java は、プリミティブ型 (int、double、boolean) と参照型 (String、List) をサポートします。 2. フローの制御 if/else、switch/case、ループ (while、do-while、for) を使用して、プログラム フローを制御します。条件付きステートメントは条件をチェックし、分岐ステートメントは条件に基づいてさまざまなコード ブロックを実行します。 3. 配列 配列は、同じ型の要素のコレクションを格納します。配列は [] 型で宣言され、要素にはインデックスによってアクセスできます。 4. クラスとオブジェクト クラスは、状態と動作を備えたオブジェクトを作成するために使用される設計図です。オブジェクトは特定のクラスのインスタンスであり、そのクラスのメンバー メソッドと変数にアクセスできます。 5. 継承されたサブクラスはフィールドと

Java メモリ モデルの実践ガイド: 同時プログラミングでよくある落とし穴を回避する方法 Java メモリ モデルの実践ガイド: 同時プログラミングでよくある落とし穴を回避する方法 Feb 19, 2024 pm 02:45 PM

可視性: スレッドは共有変数に対する自身の変更のみを確認できますが、他のスレッドによる共有変数への変更を確認するには、何らかの同期メカニズムが必要です。アトミック性: 操作は完全に実行されるか、中間状態なしでまったく実行されません。順序性: 共有変数に対するスレッド操作は、異なるスレッドであっても、特定の順序で実行する必要があります。 2. 前発生原則 前発生原則は JMM の中核となるルールの 1 つで、スレッド間の共有変数のアクセス順序を定義します。前発生の原則によれば、ある操作 A が別の操作 B の前に発生する場合、A による共有変数の変更は確実に B で行われます。

See all articles