国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Home php教程 PHP開發(fā) smarty simple template variable output method

smarty simple template variable output method

Dec 27, 2016 pm 03:54 PM

This article briefly describes Smarty’s template variable output method. Share it with everyone for your reference, the details are as follows:

config.inc.php configuration file is as follows:

include_once('smarty/Smarty.class.php');
$smarty=new Smarty();
$smarty->config_dir="smarty/Config_File.class.php";
$smarty->caching=false; //是否開啟緩存
$smarty->template_dir="./templates"; //模板目錄
$smarty->compile_dir="./templates_c"; //編譯目錄
$smarty->cache_dir="./smarty_cache"; //緩存目錄
$smarty->left_delimiter="<{";
$smarty->right_delimiter="}>";

index.php file is as follows:

include(&#39;./config.inc.php&#39;);
$title="php測(cè)試標(biāo)題";
$content="smarty練習(xí)!";
$newstext[]=array("name"=>"php程序測(cè)試","date"=>"2015-08-01");
$newstext[]=array("name"=>"php視頻教程","date"=>"2015-08-02");
$newstext[]=array("name"=>"smarty學(xué)習(xí)","date"=>"2015-08-03");
$row=array("標(biāo)題","姓名","年齡");
$smarty->assign("title",$title);
$smarty->assign("row",$row);//一個(gè)數(shù)組傳遞多個(gè)值
$smarty->assign("shownewstext",$newstext);//二維數(shù)組傳遞多個(gè)值
$smarty->assign("content",$content);
$smarty->display(&#39;index.htm&#39;);

The running results are as follows:

測(cè)試數(shù)組:標(biāo)題 | 姓名 | 年齡
--------------------------------------------------------------------------------
測(cè)試內(nèi)容為:smarty練習(xí)!
循環(huán)新聞內(nèi)容為:
php程序測(cè)試 - 2015-08-01
php視頻教程 - 2015-08-02
smarty學(xué)習(xí) - 2015-08-03

## I hope that this article will be helpful to everyone based on Smarty Template PHP programming can be helpful.

For more smarty simple template variable output methods, please pay attention to the PHP Chinese website for related articles!


Statement of this Website
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

Undress AI Tool

Undress AI Tool

Undress images for free

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.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)