백엔드 개발 PHP 튜토리얼 class.rFastTemplate.php一_PHP教程

class.rFastTemplate.php一_PHP教程

Jul 13, 2016 pm 05:24 PM
multi 하나

// 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

시각적 웹 개발 도구

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. 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. 저렴한 비용, 5. 글로벌성.

PHP PDO 고급 팁: 저장 프로시저 및 트랜잭션 사용 PHP PDO 고급 팁: 저장 프로시저 및 트랜잭션 사용 Feb 20, 2024 am 10:01 AM

저장 프로시저는 사전 컴파일되어 데이터베이스 서버에 저장되는 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의 상설 판매 가격은

자바 문법의 사원: 문법 순례를 떠나 프로그래밍 잠재력을 깨워보세요 자바 문법의 사원: 문법 순례를 떠나 프로그래밍 잠재력을 깨워보세요 Mar 30, 2024 pm 01:01 PM

변수 선언은 변수 이름, 유형 및 범위를 결정합니다. Java는 기본(int, double, boolean) 유형과 참조(String, List) 유형을 지원합니다. 2. 흐름 제어 if/else, 스위치/케이스 및 루프(while, do-while, for)를 사용하여 프로그램 흐름을 제어합니다. 조건문은 조건을 확인하고 분기문은 조건에 따라 다양한 코드 블록을 실행합니다. 3. 배열 배열은 동일한 유형의 요소 모음을 저장합니다. 배열은 [] 유형으로 선언되며 요소는 인덱스로 액세스할 수 있습니다. 4. 클래스 및 객체 클래스는 상태와 동작이 있는 객체를 생성하는 데 사용되는 청사진입니다. 객체는 특정 클래스의 인스턴스이며 해당 클래스의 멤버 메서드와 변수에 액세스할 수 있습니다. 5. 상속된 하위 클래스는 필드를 상속하고

Java 메모리 모델에 대한 실용 가이드: 동시 프로그래밍에서 흔히 발생하는 함정을 피하는 방법 Java 메모리 모델에 대한 실용 가이드: 동시 프로그래밍에서 흔히 발생하는 함정을 피하는 방법 Feb 19, 2024 pm 02:45 PM

가시성: 스레드는 공유 변수에 대한 자체 수정 사항만 볼 수 있는 반면, 다른 스레드에 의한 공유 변수 수정 사항을 보려면 일종의 동기화 메커니즘이 필요합니다. 원자성: 작업이 완전히 실행되거나 중간 상태 없이 전혀 실행되지 않습니다. 질서: 공유 변수에 대한 스레드 작업은 다른 스레드에서도 특정 순서로 수행되어야 합니다. 2. 이전 발생 원칙 이전 발생 원칙은 스레드 간 공유 변수의 액세스 순서를 정의하는 JMM의 핵심 규칙 중 하나입니다. 사전 발생 원칙에 따르면, 다른 작업 B 이전에 작업이 발생하면 A의 공유 변수 수정은 확실히 B에서 발생합니다.

See all articles