Asptemplate: A separation layer similar to phplib::template implementation

Source: Internet
Author: User
The MVC pattern is common in the Web site architecture. It allows us to build a three-tier application, isolate useful layers from code, help designers and developers work together, and improve our ability to maintain and extend existing programs.
PHP has a very famous class library Phplib, which has the Template template class. can easily implement code separation in ASP can also do this? Of course, this is Asptemplate's original intention. It completely realizes all the functions of Phplib Template, you can use it like Phplib Template, even the habit is basically not change. :)

<%

'#######################################################################
' # # Name:asptemplate
' # # By:bighan
' # # Date:nov 28, 2003
' # # site:http://asptemplate.yeah.net/
' # # Email:asptemplate@21cn.com
'##
' # # (C) Copyright 2003-2004 Bighan
'#######################################################################



Class asptemplate

'####
' # # Name of this class
' # # var string
' # # @access Private
' # # @see Property:name
'####
Private M_strname

'####
' # # version of this class
' # # var string
' # # @access Private
' # # @see Property:version
'####
Private m_strversion

'####
' # # determines how much debugging output Template would produce.
' # # is a bitwise mask of available debug levels:
' # 0 = no debugging
' # # 1 = Debug Variable assignments
' # # 2 = Debug calls to get variable
' # # 4 = Debug Internals (outputs all function calls with parameters).
'##
' # # @var int
' # # @access Private
' # # @see Property:debug
'####
Private M_intdebug

'####
' # # The base directory from which template files are loaded.
'##
' # # @var string
' # # @access Private
' # # @see property:root, Dir; Method:setroot, Set_root
'####
Private M_strroot

'####
' # # determines to output variable tags and no assigned value in templates.
'##
' # # @var string
' # # @access Private
' # # @see Property Unknown; Method:setunknowns, set_unknowns
'####
Private m_strunknowns

'####
' # # determines how Template handles error conditions.
' # # Yes ' = the error is reported, then execution is halted
' # # ' the ' # # ' is reported, then execution continues by returning ' false '
' # # ' no ' = errors are silently ignored, and execution resumes ' false '
'##
' # # @var string
' # # @access Private
' # # @see Property ishalt; Method:halt
'####
Private M_strhalterror

'####
' # # The last error message was retained in this variable.
'##
' # # @var string
' # # @access Private
' # # @see Property LastError
'##
Private M_strlasterror

'####
' # # Opening delimiter (usually "{")
'##
' # # @var string
' # # @access Private
' # # @see Property Begintag
'####
Private M_strbegintag

'####
' # # Closing delimiter (usually "}")
'##
' # # @var string
' # # @access Private
' # # @see Private Endtag
'####
Private M_strendtag

'####
' # # A hash of strings forming a translation table which translates variable names
' # # into names of files containing the variable content.
' # # M_ofile.item (varname) = "filename";
'##
' # # @var Object
' # # @access Private
' # # @see Method:setfile, Setfiles, Set_file
'####
Private M_ofile

'####
' # # Regular Expression Object
'##
' # # @var Object
' # # @access Private
'####
Private M_oregexp

'####
' # # A hash of strings forming a translation table which translates variable names
' # # into regular expressions for themselves.
' # # M_ovarkeys.item (varname) = ' {varname} '
'##
' # # @var Object
' # # @access Private
' # # @see Method:setvar, Setvars, Setappendvar, Setappendvars, Set_var
'####
Private M_ovarkeys

'####
' # # A hash of strings forming a translation table which translates variable names
' # # into the values for their respective varkeys.
' # # M_ovarvals.item (varname) = ' value '
'##
' # # @var Object
' # # @access Private
' # # @see Method:setvar, Setvars, Setappendvar, Setappendvars, Set_var
'####
Private m_ovarvals

'####
' # # Get class name attribute.
'##
' # # USA

[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] Next page >>



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.