search
Homephp教程PHP开发PHP.MVC template tag system (5)

Build a template tag system application

It only takes a few steps to build a template tag system application.
Note: The following steps assume the use of the new SleeK example application (this example can be found at www.phpmvc.net).

Modify the application's boot.ini file

The application's boot.ini file contains the information needed to obtain the PHP.MVC framework. The boot.ini file is usually located in the "WEB-INF" directory of the application. In order to set up the application, use For the template tag class, we need to define some properties in the boot.ini file.

TagActionDispatcher class

TagActionDispatcher is the standard implementation of the ActionDispatcher class. In order for the framework to read the TagActionDispatcher class, we set the value of the variable $appServerRootDir to 'TagActionDispatcher' :
// Setup the application specific ActionDispatcher (RequestDispatcher)
$actionDispatcher = 'TagActionDispatcher';

Template tag system library root directory

We also need to set the path to point to our PHP.MVC library (requires the absolute path of the file system) :
// Set php.MVC library root directory (no trailing slash).
$appServerRootDir = 'C:WWWphpmvc-base';

Optional settings

The application timer can be set on or off using the $timerRun attribute :
// Timer reporting. 1=on, 0=off
$timerRun = 1;
You can also instruct the framework to always (force) compile the application phpmvc-config.xml configuration class (best used in the development stage, because it will Slower), we use:
// The application XML configuration data set:
$appXmlCfgs = array();
$appXmlCfgs['config'] = array('name'=>'phpmvc-config.xml', 'fc'=>True);
Or only recompile the application configuration file when the phpmvc-config.xml file is modified (use this setting after development is completed, it is faster), we use:
// The application XML configuration data set:
$appXmlCfgs = array();
$appXmlCfgs['config'] = array('name'=>'phpmvc-config.xml', 'fc'=>False);

Setting up the application template directory

When setting up the template directory for a template tag application, we need to create a directory (and subdirectories) to place our application template files. This directory must be named $ in the View resource configuration class The value defined by the tplDir attribute defaults to './WEB-INF/tpl'. For example: the example application has a template directory structure set up like this:
- PhpMVC-Tags
  Index.html
  Main.php
  WEB-INF G TPL
PAGEFOOTER.SSP
PAGEHEADER.SSP
SalePageBody.ssp
Sale
PageContent.ssp
We also need to create a pages compiled by the directory. Value. The default is './WEB-INF/tpl_C'. The example application has a template directory structure set up like this:
PhpMVC-Tags
  Index.html
  Main.php
  WEB-INF
   tpl
   ...
    sale _ ... p TPL_C
PAGEFOOTER.SSPC
PAGEHEADER.SSPC
SalepageBody.sspc
sale
pageContent.sspc
We also need to create sale directory under './web-inf/tpl_c'. Library paths and inclusions

Check that the following path settings have been defined in the GlobalPaths.php and globalPRepend.php files in the "/WEB-INF" directory of your framework installation directory:
GlobalPaths.php

----- --------------------------------------------------

$appDirs[] = ' WEB-INF/lib/phpmvc_tags';

globalPrepend.php
---------------------------------- -------------
include_once 'PhpMVC_Tags.php';
If they are not added to the path, then define these variables.

Install the PHP.MVC library

Download the latest version of the PHP.MVC library: http://www.phpmvc.net/download/cvsIdx.php?doc=cvs-snaps
Unzip the library document to a directory. Modify the path settings and include settings described above .

Run the example application

Download the example application. The complete example code file and this wizard can be downloaded here: http://www.phpmvc.net/download/rel/phpmvc-tags-v1.0. zip
Extract to the web server directory. It may look like this: C:/WWW/PhpMVC-Tags
Modify the application and framework settings.
In order to test the example program, you need the homepage of the browser example program: http://localhost/PhpMVC -Tags/Index.html


Appendix A: ViewResources configuration class

The ViewResourcesConfig class represents the configuration information of the element.
The following table lists the attributes, item descriptions and default values ​​of the ViewResourcesConfig class:

PHP.MVC template tag system (5)

The above is the content of PHP.MVC’s template tag system (5). For more related articles, please pay attention to the PHP Chinese website (www.php.cn)!


Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!