큰 PHP 애플리케이션의 일부분을 수정해야합니다. 물론 다른 부분 (주로 인턴)이 작성한 부분입니다.PHP 논리 코딩 스타일
- 는 스타일, HTML과 PHP를 혼합 'PHP는 인터넷의 접착제입니다':
[가위질]
<tr class="ds_subsubhead_2">
<td colspan="21" align="left"> A <select name="nb_linge" onChange="MM_jumpMenu('parent',this,0)" style="vertical-align:middle"> <option value="<?=get('index.php',$orgurl,'nb_ligne=','22','23','9999') ?>" <? if($messagesParPage == '9999') { ?>selected="selected"<? } ?>>Tous</option>
<option value="<?=get('index.php',$orgurl,'nb_ligne=','22','23','25') ?>" <? if($messagesParPage =='25') { ?>selected="selected"<? } ?>>25</option>
<option value="<?=get('index.php',$orgurl,'nb_ligne=','22','23','50') ?>" <? if($messagesParPage =='50') { ?>selected="selected"<? } ?>>50</option>
<option value="<?=get('index.php',$orgurl,'nb_ligne=','22','23','75') ?>" <? if($messagesParPage =='75') { ?>selected="selected"<? } ?>>75</option>
[중략] 또는
[중략] 또는
<script type="text/javascript" src="<?=$_SESSION["path"]?>lib/js/ajax.js"></script>
[싹둑]
- ... 그리고 더 많은 절차 적 방법, 예 : 이
[중략]
$output .= '<td valign="top"><form name="form5" method="GET" action=""><select name="m" onchange="this.form.submit()">';
if (empty($_GET['p'])) $output .= '<option value=" ">All</option>';
else $output .= '<option value='.$_GET['m'].'>'.$_GET['m'].'</option>';
$query = "SELECT DISTINCT maoie FROM ".$BD."site";
$res = mysql_query($query);
while ($row = mysql_fetch_assoc($res)) {
if(!empty($row['maoie'])) $output .= '<option value="'.$row['maoie'].'">'.$row['maoie'].'</option>';
}
$output .= '</select></form></td>';
$output .= add_more_stuff();
echo $output;
이제는 이것이 확실하지 않습니다. a 더 많은 것 절차적인 방법, 그러나 적어도 이전과 다르다. 어느 쪽이 입니까?이 더 좋을까요?
저는 개인적으로 '인터넷 스타일의 접착제'를 좋아하지 않습니다.
거룩한 스파게티 배트맨! –