[331]
¶óÀ̼¾½º [9] Á¦°øµÇ´Â ¸Þ´º¾ó [2] ¼¼¹«¼­½Å°í,»ç¾÷ÀÚµî·Ï [17] ÀüÀÚÁöºÒ¼­ºñ½º [7]
¹®ÀÚ¸Þ¼¼Áö [7] µµ¸ÞÀÎ ¹× À¥È£½ºÆà [37] °³ÀÎÁ¤º¸,º¸¾È¼­¹öÀÎÁõ [14] È£½ºÆÃÀÌÀü ¹× À缳ġ [11]
A/S Á¤Ã¥ [4] ¾÷±×·¹À̵åÁ¤Ã¥ [4] ¼Ö·ç¼Ç¼³Ä¡ [10] ¼Ö·ç¼Ç±â´É [92]
Ãʺ¸ÀÚÀÌ¿ë¾È³» [78] ÇÁ·Î±×·¥¼öÁ¤ [23] ¼Ö·ç¼Ç±¸¸Å½Åû¹æ¹ý [8] ÇØ¿Ü°ü·Ã [3]


  °øÅëÀ¸·Î »ç¿ëµÇ´Â HTMLÆÄÀÏÀ» include ÇÏ´Â ¹æ¹ý ¾ø³ª¿ä?

º¸Åë PHP¿¡¼­ include ¸¦ Çϱâ À§Çؼ­´Â ¾Æ·¡¿Í °°Àº ¹æ½ÄÀ» »ç¿ëÇÕ´Ï´Ù.

<? include ("test.html"); ?>

À§¿Í °°Àº ¹æ½ÄÀ¸·Î include¸¦ ÇÏ°Ô µÇ¸é test.html ÆÄÀÏÀ» °¡Á®¿À°Ô µË´Ï´Ù.
ÀúÈñ ¼Ö·ç¼Çµµ À§¿Í°°Àº ¹æ½ÄÀ¸·Î htmlÆÄÀÏÀ» È£Ãâ°¡´ÉÇÕ´Ï´Ù.

´Ù¸¸ À§¿Í°°ÀÌ È£ÃâÇÏ°Ô µÉ °æ¿ì ÀúÈñ ¼Ö·ç¼Ç¿¡¼­ »ç¿ëÇÏ´Â ÃßÃâű׸¦ ÇØ´ç include µÈ ÆÄÀÏ¿¡¼­ »ç¿ëÀÌ ºÒ°¡´ÉÇÕ´Ï´Ù.

Áï À§ÀÇ ¿¹¸¦ µé¾î test.html ÆÄÀÏ¿¡¼­
{{°Ô½ÃÆǺ¸±â ÆäÀÌÁö´ç7°³,°¡·Î1°³,Á¦¸ñ±æÀÌ45ÀÚ,º»¹®±æÀÌ0ÀÚ,°øÁö»çÇ×,bbs_rows_output_03.html,´©¶ô0°³,,,0/0}}
À§¿Í°°Àº ÃßÃâűװ¡ »ç¿ë ºÒ°¡´ÉÇÏ°Ô µË´Ï´Ù.

À̸¦ »ç¿ë°¡´ÉÇÏ°Ô ÇϱâÀ§ÇÑ ¹æ¹ýÀ» ¾Ë·Áµå¸®µµ·Ï ÇÏ°Ú½À´Ï´Ù.

inc/lib.php ¶Ç´Â inc/board_function.php ÆÄÀÏ¿¡ ¾Æ·¡¼Ò½º¸¦ Ãß°¡ÇÕ´Ï´Ù.
 

// {{ÀÎŬ·çµå top_menu.html}}
function include_template($Template)
{
	global $TPL, $skin_folder;

	if( !(is_file("$skin_folder/$Template")) )
	{
		print "$skin_folder/$Template ÆÄÀÏÀÌ Á¸ÀçÇÏÁö ¾Ê½À´Ï´Ù. ";
		return;
	}

	$random = rand()%1000;
	$TPL->define("ÀÎŬ·çµå_$random", "$skin_folder/$Template");
	$content = $TPL->fetch("ÀÎŬ·çµå_$random");

	print $content;
}


±×¸®°í inc/function.php ÆÄÀÏÀÇ ¾Æ·¡ ¹è¿­¿¡ ´ÙÀ½°ú °°ÀÌ Ãß°¡ÇÕ´Ï´Ù.
$TemplateM_name	= Array(
						"¸ÞÀθŹ°",
						"¸ÅÀå¸Å¹°",
						"ÃÖ´ÙÆǸÅ",
						...
						»ý·«
						...
						"°Ô½ÃÆǺ¸±â",
						"ÀÎŬ·çµå"
);

$TemplateM_func	= Array(
						"main_extraction",
						"list_extraction",
						"main_sell_extraction",
						...
						»ý·«
						...
						"board_extraction_list",
						"include_template"
);

$TemplateM_name ¹è¿­ ¸¶Áö¸·¿¡ "ÀÎŬ·çµå" ¸¦ Ãß°¡ÇØÁֽðí,
$TemplateM_func ¹è¿­ ¸¶Áö¸·¿¡ "include_template" ¸¦ Ãß°¡ÇØÁÖ½Ã¸é µË´Ï´Ù.

±×¸®°í À§ ¿¹Á¦ÀÇ
<? include("test.html") ?>

À§ ¹æ½ÄÀ» ¾Æ·¡¿Í °°Àº ¹æ½ÄÀ¸·Î »ç¿ëÇÏ½Ã¸é µË´Ï´Ù.
{{ÀÎŬ·çµå test.html}}

ÀÌ·¸°Ô ÇϽøé test.html ÆÄÀÏ¿¡¼­ ÀúÈñ ¼Ö·ç¼ÇÀÇ ÃßÃâű׵µ »ç¿ëÀÌ °¡´ÉÇØÁý´Ï´Ù.


¸ñ·Ï Àüü¸ñ·Ï