php - Replace die statement -
currently code looks this
<?php if($controlsomething) { include(header); echo "something"; include(footer); die(); } if($anothercontrol) { include(header); dosomeoperations(); // throw error if $controlsometing true echo "something else"; include(footer); die(); } ?>
clearly not way things. want move cleaner.
i created view class wrap page , avoid include(header)/include(footer) repetition. converted conditional statement, changing if($condition)
function condition ()
.
now should ? thinking of :
if(condition1()) { message condition1 ...} else if(condition2()) {}
the problem file might included file executed because there no die statement anymore.
so should include var "die" in view object , check value before doing on every page ? doesn't seem clean me. have thousands of lines of code more simple/automated solution, better.
Comments
Post a Comment