Smarty Ä£°å ´Óphp·ÖÅäµÄ±äÁ¿
index.php:
$smarty = new Smarty;
$smarty->assign('Contacts',
array('555-222-9876',
'zaphod@slartibartfast.com',
array('555-444-3333',
'555-111-1234')));
$smarty->display('index.tpl');
index.tpl:
{$Contacts[0]}<br>
{$Contacts[1]}<br>
{* you can print arrays of arrays as well *}
{$Contacts[2][0]}<br>
{$Contacts[2][1]}<br>
OUTPUT:
555-222-9876<br>
zaphod@slartibartfast.com<br>
555-444-3333<br>
555-111-1234<br>
Ïà¹ØÎĵµ£º
PHP ¹ýÂËÆ÷ÓÃÓÚÑéÖ¤ºÍ¹ýÂËÀ´×Էǰ²È«À´Ô´µÄÊý¾Ý£¬±ÈÈçÓû§µÄÊäÈë¡£
ʲôÊÇ PHP ¹ýÂËÆ÷£¿
PHP ¹ýÂËÆ÷ÓÃÓÚÑéÖ¤ºÍ¹ýÂËÀ´×Էǰ²È«À´Ô´µÄÊý¾Ý¡£
ÑéÖ¤ºÍ¹ýÂËÓû§ÊäÈë»ò×Ô¶¨ÒåÊý¾ÝÊÇÈκΠWeb Ó¦ÓóÌÐòµÄÖØÒª×é³É²¿·Ö¡£
Éè¼Æ PHP µÄ¹ýÂËÆ÷À©Õ¹µÄÄ¿µÄÊÇʹÊý¾Ý¹ýÂ˸üÇáËÉ¿ì½Ý¡£
ΪʲôʹÓùýÂËÆ÷£¿
¼¸ºõËùÓÐ web Ó¦ÓóÌÐò¶¼ÒÀ ......
這個問題ÓÐ點Ææ¹Ö£¬ÔÚJavaºÍ.netµÄÊÀ½ç裡還δÅöµ½過.......
¿´來PHP對對ÏóµÄÖ§³Ö還²»ÊÇÌ«ÓѺ㬺ǺÇ~~~
[轉載ì¶£º] http://blog.csdn.net/yehell/archive/2007/12/19/1953826.aspx
½ñÌìÔÚphpÎļþÖÐÉèÖÃÁËÒ»¸ösession.²¢½«Ò»¸öÀ ......
When I deploy php application on apache, some problem come out, and solved. Here's the tips and problems solved.
0.How could I deploy an apache server armed with php, mysql, perl, and phpMyAdmin on the fly?
You need a package bundled with all these tools, xampp shall meet you needs, you can ......
1.»ù±¾Àà
//smarty_config.php
<?php
define('TEMPLATE_DIR','templates/');
define('COMPILE_DIR','templates_c/');
define('CONFIG_DIR','configs/');
define('CACHE_DIR','cache/');
?>
//View.class.php
<?php
//ÅäÖÃÎļþ
require_once 'configs/smart_config.php';
//SmartyÀà
require('smarty/ ......
ÔÎÄÁ´½Ó£ºhttp://www.phpdo.net/index.php/2010/01/27/1-3/
×òÌìÎÒÃÇʵÏÖÁËPHPµÄµÚÒ»¸öÒ³Ãæhello£¬world£¡
PHPµÄÓïÑÔ¹¹³ÉÓ빤×÷ÔÀíÊÇÊ²Ã´ÄØ£¿
ºê¹ÛµØ½«£ºÒ»¸öÍêÕûµÄPHP³ÌÐòÊÇÓÉÖ÷³ÌÐòºÍº¯Êý¹¹³É¡£PHP³ÌÐòµÄÖ´ÐдÓÖ÷³ÌÐò¿ªÊ¼£¬µ÷ÓÃÆäËûº¯Êýºó·µ»ØÖ÷³ÌÐò²¢½áÊø¡£
ÔÚPHPµÄÖ÷³ÌÐòºÍº¯ÊýÖУ¬PHPº¯ÊýµÄ»ù ......