Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

php smarty»ù±¾Ê¹ÓÃ

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/Smarty.class.php');
class View extends Smarty {
function SmartyFactory() {
$this->Smarty();
//Ä£°å·¾¶
$this->template_dir = TEMPLATE_DIR;
//±àÒëºóÎļþ
$this->compile_dir = COMPILE_DIR;
//ÅäÖÃÎļþ
$this->config_dir = CONFIG_DIR;
//»º´æÎļþ
$this->cache_dir = CACHE_DIR;
$this->debugging = true;
}
//ÖØзâ×°display ¸öÈËÏ°¹ß¸Ä³Éshow
function show($name,$cacheId='') {
if($cacheId == '')
$this->display($name.'.htm');
else
$this->display($name.'.htm',$cacheId);
}
//ÖØзâ×°assign Ï°¹ßÓÃadd
function add($name,$value) {
$this->assign($name,$value);
}
}
?>
»ù±¾Ä¿Â¼Èç:
test
    |-configs
    |-templates
    |-templates_c
    |-cache
    |-smarty --smarty lib
2.»ù±¾Ê¹ÓÃ
//index.php
<?php
require_once('View.php');
//Êý¾Ý²éѯ mysql_fetch_assoc() ·µ»ØÊý×é
//Êý¾Ý¿â²ã·â×°
//Èç:$User = new User();
//$Users = $User->paging('²ÎÊý');
$View = new View();
$View->add("users",$Users);
$View->show("index");
?>
//public.conf
[public]
public = public/
img = public/img/
css = public/css/
js = public/js/
//index.htm --ÔÚtemplatesÎļþ¼ÐÏ ¼ò¶Ì½éÉÜÏÂ
<html>
<!-- °üº¬meta.htmÎļþ-->
{include file="meta.htm"}
<!-- ÀûÓÃsmarty configÎļþ ¶¨Òå»ù±¾ÐÅÏ¢-->
{config_load file=public.conf section="public"}
<!-- ÂÔ -->
<table>
 <tr>
  <!-- {#img#} imgµÄ»ù±¾Â·¾¶ ¶ÔÓÚÒ»°ãСÍøÕ¾µÄ×ö·¨ ÈçÓÐÊÇʹÓÃÁ˶þ¼¶ÓòÃûµÄ¾²Ì¬·þÎñÆ÷û±ØÒªÁË-->
  <td><input type="image" src="{#img#}xxx.gif"/></td>
 </tr>


Ïà¹ØÎĵµ£º

PHPÕûºÏFCKeditor


ÉùÃ÷£¬ÎÒÓõÄPHP¿ò¼ÜÊÇCI£¨codeignitor)£¬µ«ÆäʵÒòΪÊÇÓÃJSµ÷ÓÃFCKeditorµÄ£¬ËùÒÔÕâ¸öºÍ¿ò¼ÜûÓйØϵ
Ê×ÏÈÏÂÔØFCKeditor 2.6.3 £¨ÎÒʹÓõÄÊÇÕâ¸ö°æ±¾£©
¿ÉÒÔÔÚCSDNÖÐÏÂÔØ
½âѹ£¬½«FCKeditor2.6.3ÏÂÃæµÄfckeditorÕû¸öÎļþ¼Ð¸´ÖƵ½ÍøÕ¾¸ùĿ¼(ºÍindex.php£©Í¬Ò»¸öĿ¼£¬²¢¸üÃûΪfck£¨²»¸ÄÃûÒ²ÐУ¬µ«ºóÃæÉèÖøù·¾¶µÄʱºò ......

ÎÒµÄPHP×î¼Ñ±à³Ì¹¤¾ßÊÇphpcn5.0

ÎÒ´ÓÊÂÁË6Äê¶àµÄ±à³Ì¹¤×÷£¬ÔÚÕâ֮ǰ×öÁ˽«½ü2ÄêµÄ´¿HTML+CSSµÄÍøÒ³ÖÆ×÷ºÍÉè¼Æ¡£±¾²©¿ÍºÜ¶à´ÎÌáµ½µÄphpcn5.0£¬ÊÇÒ»¿î¼ò½àʵÓõÄÎı¾¹¤¾ß¡£¶ÔÓÚPHP±à³ÌÓÐÊ®·ÖºÃµÄÖ§³Ö£¬¼¸ºõµ½ÁËÍêÃÀ¡£ÎÒµÄPHPÊ×Ñ¡±à³Ì¹¤¾ßÊÇphpcn5.0£¬Ê¹ÓÃphpcn5.0×öPHP±à³Ì£¬¼¸ºõ²»ÓÃÔÙÓÃÆäËüµÄÎı¾¹¤¾ß¡£¶ÔÓÚPHP±à³Ì£¬phpcn5.0ÓÐÕâЩÓŵ㣺
   1 ......

Ϊʲô΢²©¿Íϵͳ¶¼ÊÇÓõÄphp×öµÄ

Ϊʲô΢²©¿Íϵͳ¶¼ÊÇÓõÄphp×öµÄ
Ò»:phpÓÐһϵÁкܼòµ¥¸ßЧµÄÔ­ÉúÄ£°åÖ§³Öº¯Êý.²©¿Íϵͳһ°ãÇé¿ö϶¼ÐèÒªÓõ½Ä£°å.¶øphpµÄÄ£°åÖ§³ÖÄÜÁ¦,¿ÉÒÔÓÐЧ½µµÍÍøվģ°åµÄ¿ª·¢.
¶þ:ͬʱphpµÄÕâһЩÁÐÖ§³Öº¯Êý¶¼ÊÇÔ­ÉúÖ§³Ö,²¢·ÇÍâ¹ÒÖ§³Ö,¸ü²»ÐèҪģ°å¿ª·¢ÈËԱרÃÅ¿ª·¢Ò»Ì׽ű¾¼¶µÄ´¦Àí·½·¨.phpµÄÕâЩ֧³Ö¶¼ÊÇcÓïÑÔ¼¶µÄÖ§³Ö.ÔËÐÐËÙ¶È ......

С´úÂ루PHP£©

1.
error_reporting(E_ERROR | E_WARNING | E_PARSE);    //±¨´í¼¶±ð
@set_time_limit(1000);    //ÉèÖú¯ÊýÖ´ÐеÄ×î´óʱ¼ä
set_magic_quotes_runtime(0);    //ΪÁË°²È«
define('IN_COMSENZ', TRUE);
define('ROOT_PATH', dirname(__FILE__).'/../');    ......

PHP¿ª·¢¹æ·¶£¡

Ò»¡¢¹æ·¶Ç°ÑÔƪ
±ê×¼»¯²»ÊÇÌØÊâµÄ¸öÈË·ç¸ñ£¬ËüÈóÌÐòÔ±¿ÉÒÔÁ˽âÈκδúÂ룬ŪÇå³ÌÐòµÄ×´¿ö£»ÐÂÈË¿É
ÒԺܿìµÄÊÊÓ¦»·¾³£»·ÀֹнӴ¥phpµÄÈËÒ»´Î´ÎµÄ·¸Í¬ÑùµÄ´íÎó£»ÔÚÒ»ÖµĿª·¢»·¾³Ï£¬
¿ÉÒÔ¼õÉÙÈËÃÇ·¸´íµÄ»ú»á¡£±¾¹æ·¶µÄ±ê×¼ÔÚ¾ø¶Ô¶àÊýÓ¦ÓÃÉÏΪ·ÂÕÕjava¼¼ÊõÌåϵ£¬ÒòΪ
java¼¼ÊõÌåϵÒÔÆäÖÚ¶à³É¹¦µÄ°¸Àý³ÉΪ´ó²¿·Ö¼ÆËã»úÓ¦Ó ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ