Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to set template tags for PHP.MVC

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article introduces you how to set the template tag of PHP.MVC, the content is very detailed, interested friends can refer to, hope to be helpful to you.

The application's boot.ini file contains the information you need to get the PHP.MVC framework. The boot.ini file is usually located in the application's "WEB-INF" directory. To set up the application to use the template tag class, we need to define some properties in the boot.ini file. The following editor to explain how to set the template tag of PHP.MVC?

How to set template tags for PHP.MVC

TagActionDispatcher is the standard implementation of the ActionDispatcher class. In order for the framework to read the TagActionDispatcher class, we set the variable $appServerRootDir to 'TagActionDispatcher':

/ / SetuptheapplicationspecificActionDispatcher (RequestDispatcher)

$actionDispatcher='TagActionDispatcher'

Template label system library root directory

We also need to set the path to our PHP.MVC library (absolute path to the file system is required):

/ / Setphp.MVClibraryrootdirectory (notrailingslash).

$appServerRootDir='C:\ WWW\ phpmvc-base'

Optional settin

The application timer can be set on or off using the $timerRun property:

/ / Timerreporting.1=on,0=off

$timerRun=1

You can also instruct the framework to always (force) compile the application phpmvc-config.xml configuration class (preferably during the development phase, because it is slow), we use:

/ / TheapplicationXMLconfigurationdataset:

$appXmlCfgs=array ()

$appXmlCfgs ['config'] = array (' name'= > 'phpmvc-config.xml','fc'= > True)

Or to recompile the application configuration file only when the phpmvc-config.xml file is modified (using this setting after development is complete, it is fast), we use:

/ / TheapplicationXMLconfigurationdataset:

$appXmlCfgs=array ()

$appXmlCfgs ['config'] = array (' name'= > 'phpmvc-config.xml','fc'= > False)

Set up the application template directory

When setting up a template directory for a template tag application, we need to create a directory (and subdirectories) and place our application template files. This directory must be named as the value defined by the $tplDir attribute of the View resource configuration class. The default is'. / WEB-INF/tpl'. For example, the example application has a template directory structure set like this:

-PhpMVC-Tags

Index.html

Main.php

WEB-INF

Tpl

PageFooter.ssp

PageHeader.ssp

SalePageBody.ssp

Sale

PageContent.ssp

How to set template tags for PHP.MVC

We also need to create a directory to place the compiled page. This directory must be named as the value defined in the $tplDirC attribute of the View resource configuration class. The default is'. / WEB-INF/tpl_C'. The example application has a template directory structure set like this:

PhpMVC-Tags

Index.html

Main.php

WEB-INF

Tpl

...

Sale

...

Tpl_C

PageFooter.sspC

PageHeader.sspC

SalePageBody.sspC

Sale

PageContent.sspC

Note that we also need to create the sale directory under'. / WEB-INF/tpl_C'.

Set the path and content of the PHP.MVC library

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

GlobalPaths.php

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

GlobalPrepend.php

Include_once'PhpMVC_Tags.php'

If they are not being 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

Extract the library documents to a directory. Modify the path settings and inclusion settings described above.

Run the example application

Download the sample application. The complete sample code file and the wizard can be downloaded here: http://www.phpmvc.net/download/rel/phpmvc-tags-v1.0.zip

Extract to the web server directory. It could be like this: C:/WWW/PhpMVC-Tags

Modify application and framework settings.

To test the example program, you need the home page of the browser sample program: http://localhost/PhpMVC-Tags/Index.html

On how to set PHP.MVC template tags to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report