2010年11月16日星期二

[fw-mvc] How to clear view placeholders? (headTitle, headLink, headScript, inlineScript...)

Right now i'm doing this:

<?php
$phEmpty = array('headTitle', 'headLink', 'headScript', 'inlineScript');
foreach ( $phEmpty as $phn ) {
$ph = $view->$phn();
$phikeys = array();
foreach ( $ph as $phik => $phiv ) array_push($phikeys, $phik);
foreach ( $phikeys as $phik ) unset( $ph[$phik] );
}
?>

Is there a better way?

Thanks

没有评论: